7
Answers

how to get the details from select query like where in

Hi All,
I'm New to LINQ, can you help me
how to get the details from select query like where in clause
ex:
  1. public List<LocationDetailInfo> GetLocationsListDB(string[] areaId)  
  2. {  
  3. using (DbHelper db = new DbHelper())  
  4. {  
  5. var locationList = (from location in db.LocationMasters  
  6. where areaId.Contains(location.AreaId.ToString()) //Ids.Contains(location.AreaId)  
  7. select new LocationDetailInfo  
  8. {  
  9. LocationId = location.LocationId,  
  10. LocationName = location.LocationDesc  
  11. }).OrderBy(o => o.LocationName).Distinct().ToList();  
  12. return locationList;  
  13. }  
  14. }  
but this logic is not get the details

Answers (7)