Deep null check inside linq expression, is there a better way?
Try to do not do any null checks in LINQ to Entities query. EF should handle nulls automatically:
_collection.Select(x=> new CollectionModel
{
Title = x.CollectionValues!.FirstOrDefault(x => x.Amount == amount)!
.TranslationTitle.TranslationValues!
.FirstOrDefault(x => x.LanguageId == languageId)!
.Value ?? ""
}
);