how to remove repeated record's from results linq to sql
- by Sadegh
hi, i want to remove repeated record's from results but distinct don't do this for me! why???
var results = (from words in _Xplorium.Words
join wordFiles in _Xplorium.WordFiles on words.WordId equals wordFiles.WordId
join files in _Xplorium.Files on wordFiles.FileId equals files.FileId
join urls in _Xplorium.Urls on files.UrlId equals urls.UrlId
where files.Title.Contains(query) || files.Description.Contains(query)
orderby wordFiles.Count descending
select new SearchResultItem()
{
Title = files.Title,
Url = urls.Address,
Count = wordFiles.Count,
CrawledOn = files.CrawledOn,
Description = files.Description,
Lenght = files.Lenght,
UniqueKey = words.WordId + "-" + files.FileId + "-" + urls.UrlId
}).Distinct();