I have this method that I wrote as:
private void GetReceivedInvoiceTasks(User user, List<Task> tasks) { var taskList = from i in _db.Invoices join a in user.Areas on i.AreaId equals a.AreaId where i.Status == InvoiceStatuses.Received select i; }
Basically, I tried to get all the accounts in the database in the user area that have received status. I don't understand LINQ very well right now.
I get an error:
base {System.SystemException} = {"It is not possible to create a constant value of type 'Models.Area'. Only primitive types (such as Int32, String and Guid ') are supported in this context."}
Can someone explain to me what I'm doing wrong and how to fix it? I canβt understand now what the problem is. If I cross off the join line, thatβs fine, but I really need this line to make sure that I only have accounts from user area / areas (they can belong to more than one area). Is there something wrong with this request?
linq linq-to-entities entity-framework
AnonyMouse Apr 09 2018-12-12T00: 00Z
source share