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
Post a Comment