I have three tables
SalesDetailswith columns SalesId, ProductId, Qty, Price etcSalesPersonDtlswith columns SalesId, SalesPersonId, CommPercentage etcSalesPersonwith columns SalesPersonId, firstName, lastName etc
I have second table because one sale can be done by more than one sales person together with split commission.
I have various inputs in search screen like productname, sales date, sales person name etc.
I am making the model class as 'AsQueryable' and add various where conditions and finally the result into a list.
I have sales person's name in search criteria but I don't know how to include this into the search. Can you please help?
Thanks Peter
var matches = context.SalesDetails.Select(** Project Your Needed Data Here **).Where(sd => sd.SalesPersons.Any(sp => sp.lastName == "Jones" && sp.firstName == "Peter").ToList().