S
shapper
Hello,
I am getting a record as follows:
User user = _context.Users.FirstOrDefault(u => u.Id ==
task.User.Id);
How can I make user to be null if no user is found with such an id.
At the moment I get an exception ... If I use only First I also get an
exception.
Thanks,
Miguel
I am getting a record as follows:
User user = _context.Users.FirstOrDefault(u => u.Id ==
task.User.Id);
How can I make user to be null if no user is found with such an id.
At the moment I get an exception ... If I use only First I also get an
exception.
Thanks,
Miguel