Wednesday, October 14, 2020

Distinct list in LINQ

     var search_item = (from n in db.ShobdiboItems select n.ItemName).Distinct().ToList();

    foreach (var ss in search_item)

    {

        listitem.Add(new SelectListItem { Text = ss, Value = ss });

       

    }

No comments:

Post a Comment