Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. //OLD VERSION
  2. var GUIs;
  3. var VMs;
  4. if (activeIsSelected) {
  5.   GUIs = (from g in db.GUILicenseGrants
  6.           where g.Grant_History.Job_ID == VMJob.ID
  7.           && g.Grant_History.Hardware_Assoc != null
  8.           select g).ToList();
  9.  
  10.   VMs = (from n in db.NodeLicenseGrants
  11.          where n.Grant_History.Job_ID == VMJob.ID
  12.          && n.Grant_History.Hardware_Assoc != null
  13.          select n).ToList();
  14. }
  15. else {
  16.   GUIs = (from g in db.GUILicenseGrants
  17.           where g.Grant_History.Job_ID == VMJob.ID
  18.           && g.Grant_History.Hardware_Assoc == null
  19.           select g).ToList();
  20.  
  21.   VMs = (from n in db.NodeLicenseGrants
  22.          where n.Grant_History.Job_ID == VMJob.ID
  23.          && n.Grant_History.Hardware_Assoc == null
  24.          select n).ToList();
  25. }
  26.  
  27. //NEW VERSION
  28. var GUIs = (from g in db.GUILicenseGrants
  29.             where g.Grant_History.Job_ID == VMJob.ID
  30.             && !(activeIsSelected ^ g.Grant_History.Hardware_Assoc != null)
  31.             select g).ToList();
  32.  
  33. var VMs = (from n in db.NodeLicenseGrants
  34.             where n.Grant_History.Job_ID == VMJob.ID
  35.             && !(activeIsSelected ^ n.Grant_History.Hardware_Assoc != null)
  36.           select n).ToList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement