我有兩個實體模型 -查找列表中的項目存在於另一個列表
public SalesPerson
{
int PersonId; int DistributionHouseId;
{
public SalesRecord
{
int RecordId; int PersonId; datetime SalesDate;
{
var persons = Db.SalesPersons.Where(m => m.DistributionHouseId == 1).ToList();
var salesRecords = Db.SalesRecords.Where(m =>
persons.Any(x => x.PersonId==m.PersonId)
&& DbFunctions.TruncateTime(m.SalesDate) == date)
.ToList();
這讓我異常Only primitive types or enumeration types are supported in this context.
你'SalesRecord'有兩個'RecordId',而且這兩個類在類的最後都有'{''來代替'}'。 – dasblinkenlight