Hi I'm using linq to entity in my application. I need to get distinct records based on one column value "Name"
So I have a table similar like you can see below:
(User)
ID
Name
Country
DateCreated
I need to select all this items but uniques based on Name (unique). Is it possible to accomplish using linq, if so please show me how.
var items = (from i in user select new {i.id, i.name, i.country, i.datecreated}).Distinct();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…