Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public int GetID(int ID)
  2. {
  3.  
  4. int ID = Convert.ToInt32(uow.repo.GetQueryable().Where(rh => rh.ID== ID && rh.Status == 0).OrderByDescending(o => o.Rev).Select(s=>s.ID));
  5. return ID;
  6. }
  7.  
  8. int ID = Convert.ToInt32(
  9. uow.repo.GetQueryable()
  10. .Where(rh => rh.ID== ID && rh.Status == 0)
  11. .OrderByDescending(o => o.Rev)
  12. .Select(s=>s.ID) //this still is a collection
  13. .FirstOrDefault()); //this takes the first one.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement