EFReadonlySession Single gives exception "Sequence Contains more than one element"

Oct 21, 2011 at 2:20 PM
Edited Oct 21, 2011 at 2:23 PM

 

Hi there

 

I am getting an exception "Sequence contains more than one element" when attempting to use the EFReadonly Single<T> function for example in

_readOnlyDb.Single<ClassNameHere>(x => x.Id== id);

 
public T Single<T>(System.Linq.Expressions.Expression<Func<T, bool>> expression) where T : class, new 
() { 

return new ObjectQuery<T>(GetSetName<T>(), _context, MergeOption 
.NoTracking).SingleOrDefault(); 

}


 

The  EFSession version of the same function is working fine.

Thanks

K