I have tried following code i need to random row with out duplication based on the NAME field.
List list = db.Logos.Where(a => a.LogoName != "empty.png").OrderBy(r => Guid.NewGuid()) .GroupBy(a => a.LogoName) .Select(g => g.FirstOrDefault()).Take(8).ToList();
but i did not get randomly but i have tried another code which is shuffling correctly but duplicate code could not apply, code below
List list = (from c in db.Logos where c.LogoName != "empty.png" select c).OrderBy(r => Guid.NewGuid()).Take(3).ToList();
please help how to select both duplication and random rows.