I want to return a list of tickets which are currently in one of the given statuses. There's an array of the enum TicketState (with values Open, InProgress and Finished).
public IEnumerable<Ticket> ReadTickets(TicketState[] states)
{
return ctx.Tickets.Where(t => states.Contains(t.State)).AsEnumerable();
}
The following exception appears when I test the method:
Cannot compare elements of type 'Project.BL.Domain.Ticketing.TicketState[]'. Only primitive types, enumeration types and entity types are supported.
I've tried to make a list from the array and to use an array of bytes instead, but I keep getting exceptions.
Does anyone know how I can fix this?