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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -