This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Currently Find given a query always returns a list but often I write a query expecting it to only give one result. With a list you have to do a bunch of extra logic each time you do this, i.e. if the list is empty assign null to the Entity variable, if the list has one result assign it to the Entity variable, if the list returns multiple results then throw an exception IList<Device> currentSessionDeviceResult = Repository.Find<Device>( Would it be possible to add a FindEntity method to Repository that takes a query and returns a single Entity? |
|
|
Hi James, I've added FindOne overloads to 0.7 - Find(object id) has also been renamed to match. Cheers, Andrew |
|