Hy guys!
My app is doing a query like this:
public Order GetOrderByPerson(Order order, Person person)
{
return Repository.All()
.Where( x => x.Order == order )
.Where( y => y.envolvedPerson == person )
.Single();
};
And when there is no elements, it returns an error:
Sequence contains no elements
Is ok to return null, how can I prevent this error?
Tks.
do
and check if its null in the calling method