I am working with a third party database and need to select a distinct set of data for the specific market that I am looking into. The data is the same for each market, so i
You could use group by
with the properties that you want to be distinct, then select the first item of each group:
determinantData = (from x in dbContext.Datas
where x.Bar.Name.Equals(barName) &&
x.Something.Name.Equals(someName) &&
FooIds.Contains(x.Foo.Id) &&
x.Date >= startDate &&
x.Date <= endDate
group x by new { x.Foo, x.Bar, x.Something } into market
select market).Select( g=> g.First());