I know that the ternary operator ("?") can be used checking if the value is null and if it's not null proceeding to the "chained methods let's call it". Example: Model?.FirstOrDefault(); Why doesn't this work? I want to say "if the Model is not empty call the FirstOrDefault method, else don't do anything". Getting this error
System.NullReferenceException: 'Object reference not set to an instance of an object.'
System.Linq.Enumerable.FirstOrDefault(...) returned null.
Modelis not null but also contains no elements?