SHARE
TWEET

Untitled

a guest Jul 16th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top