Hi,
I need distinct names
I am getting error as per my need to get only row instated of 29999
Rows can you please help me
public List<Emplpoyee> GetList()
{
var result = Enumerable.Range(0, 300000).Select(i => new Emplpoyee
{
Id = i,
Name = "ShipName",
});
return result.ToList();
}
public JsonResult GetEmployees2()
{
var countriesList = GetList();
//need all values where shipname is distinct
countriesList = countriesList.Select(new { }).Distinct().ToList();
return Json(countriesList, JsonRequestBehavior.AllowGet);
}
countriesList = countriesList.Select(x=>new { x.Id,x.Name}).Distinct().ToList();