c# - Filter Entity Framework enumerable on Distinct property -



c# - Filter Entity Framework enumerable on Distinct property -

the next statement not returning distinct values, whole list:

public observablecollection<masterpartslist> parentassemblybom { { var enumerable = this._parentassemblybom .where(parent => parent.isassy == true).distinct(); homecoming new observablecollection<masterpartslist>(enumerable) ; }

truly, should able tell object unique because this._parentassemblybom.partnumber distinct property. how work in logic yield right results?

thanks in advance!

try grouping identifier (in case part number) , select first of group:

var enumerable = this._parentassemblybom .where(parent => parent.isassy == true) .groupby(x => x.partnumber) .select(x => x.firstordefault());

c# wpf entity-framework filter

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -