How to get value of multiple id from Linq

first get the multiple id of table of which you want to get the value after that you can use this query

Code Snippet
  1. List<int> result = new List<int>();
  2.             result.Add(1);
  3.             result.Add(5);
  4.             result.Add(7);
  5.             result.Add(8);
  6.             using (var db = new model())
  7.             {
  8.                 var emp = (from mp in db.emp where  result.Contains(mp.id) select mp).ToList();
  9.             }
Posted by: ritesh.kumar

Categories: ASP.NET

Tags: ,

Add comment

  Select your country

biuquote
  • Comment
  • Preview
Loading