Prevent query error

0

I have this query in Linq:

var results = (from u in db.datos
                      where u.IdLogin == id
                      select u).ToList();

The problem arises when the user has not filled out their data and marks me an error since it does not find results, I had solved it with a try and catch but I would like to know if there is another way to solve this error .

    
asked by JPerez 13.02.2018 в 18:14
source

0 answers