c# - Filtering null values when != and == are overloaded -
i have overloaded != , == operators of entity type. now, when run :
dbcontext.myentitydbset.where(x => x.myproperty != null)
i'm getting exception saying
cannot compare elements of type 'myentitytype'. primitive types, enumeration types , entity types supported.
how can bypass ?
thank you
ef not know == , != overloaded. can compare primitive types. also, cannot compare 2 entities of same type (it compare them comparing primary keys hibernate does). need replicate == , != in linq query (or materialize - i.e. insert tolist() - query before bad solution).
Comments
Post a Comment