Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ensure.Argument.NotNull(template);
- var users = _userRepo
- .AllIncluding(u => u.SentEmails);
- switch (template.QueueAfter)
- {
- case QueueAfter.RegistrationDate:
- users = users.Where(ud => ud.RegisteredOn <= DateTime.Today.AddDays(template.QueueDays));
- break;
- default:
- throw new ArgumentOutOfRangeException();
- }
- var asc = UserBase.GetAccountStateCode(template.QueueAccountState);
- return users
- .Where(u => u.AccountStateCode == asc
- && u is Customer
- && !u.SentEmails.Select(s => s.EmailTemplateId).Contains(template.Id))
- .Select(user => user as Customer)
- .ToList();
Advertisement
Add Comment
Please, Sign In to add comment