Guest User

Untitled

a guest
Jun 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. var users = (from u in db.Users
  2. where ((soaStatus == 0) || (u.SOAStatusID == soaStatus))
  3. && (string.IsNullOrEmpty(areaCode) || u.Phone1.Substring(0, 3) == areaCode)
  4. && (string.IsNullOrEmpty(lastName) || u.LastName == lastName)
  5. && (string.IsNullOrEmpty(state) || (u.State == state))
  6. join uXt in db.User_x_Territories on u.Id equals uXt.UserID into sr
  7. from x in sr.DefaultIfEmpty()
  8. where (territoryID == 0 || x.TerritoryID == territoryID)
  9. select u);
Add Comment
Please, Sign In to add comment