daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var overlaps = .Session.QueryOver<DelegateOrderApproval>()
  2.     .Where(x => x.DateFrom > DateTime.Now && delegateOrderApproval.DelegatedUser.UserId == x.DelegatorUser.UserId)
  3.     .And(x => x.DateFrom >= delegateOrderApproval.DateFrom && delegateOrderApproval.DateTo <= x.DateTo
  4.               || (x.DateFrom >= delegateOrderApproval.DateFrom && x.DateTo <= delegateOrderApproval.DateTo)
  5.               || (x.DateFrom <= delegateOrderApproval.DateFrom && x.DateTo >= delegateOrderApproval.DateFrom)
  6.               || (x.DateFrom <= delegateOrderApproval.DateFrom && x.DateTo >= delegateOrderApproval.DateTo))
  7.     .List();
  8.    
  9. var doesOverlapExist = Session.QueryOver<DelegateOrderApproval>()
  10.      .Any(x =>
  11.         x.DateFrom > DateTime.Now &&
  12.         delegateOrderApproval.DelegatedUser.UserId == x.DelegatorUser.UserId &&
  13.         x.DateFrom <= delegateOrderApproval.DateTo &&
  14.         x.DateTo >= delegateOrderApproval.DateFrom);
  15.    
  16. Where(x=> blabla).Count() >0
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