var result =
(from s in emp.Salaries
select s.Salary).Last();
Listing 7.1
If you have unique id in the table the Last() can be replaced with orderby and First() method, that will be much more efficientvar result =
(from s in emp.Salaries
orderby s.EmPNo descending
select s.Salary).First();
Listing 7.2
No comments:
Post a Comment