I have this method:
public virtual IEnumerable<Invoice> GetHomePageInvoices(IList<Area> areas, FinancialYearLookup financialYear)
{
var homePageInvoices = _db.Invoices.Where(x => areas.Any(z => z.Id == 3)).ToList();
...
}
Basically I'm trying to find any invoices where the area matches with any of those in the parameter area.
I'm getting the error:
Unable to create a constant value of type 'Models.Area'. Only primitive types ('such as Int32, String, and Guid') are supported in this context.
Can anyone explain why this is happening and how to fix?