Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save forenheith/303ec6e0827f2b7f938e097a27e541b3 to your computer and use it in GitHub Desktop.
Save forenheith/303ec6e0827f2b7f938e097a27e541b3 to your computer and use it in GitHub Desktop.
filter
ticketsViewModelsCollection =
ticketsRepo.GetAll()
.Where(
m =>
(m.TicketStateId == null || m.TicketStateId == model.StateId)
&& model.Direction == TicketDirection.In
? model.EmployeeId == null
? m.RecipientId == model.DepartmentId
: m.RecipientId == model.EmployeeId
: model.EmployeeId == null
? m.SenderId == model.DepartmentId
: m.SenderId == model.EmployeeId)
.Select(ModelsMapper.GetTicketViewModel)
.ToList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment