Can I return it as an object if I'm doing a Select OneItem from Table Where OtherItem = "blah"?
Is there a better way to do this?
I'm building a constructor to return an object based on its name rather than its ID
Can I return it as an object if I'm doing a Select OneItem from Table Where OtherItem = "blah"?
Is there a better way to do this?
I'm building a constructor to return an object based on its name rather than its ID
If there's more than one potential result, then query.FirstResult()
might be better.
Or using LINQ you can have query.First(), query.SingleOrDefault(), query.Min(predicate) etc...