2
我得到这个错误类型 'System.Data.Objects.ObjectQuery`1[XXX.Model.Cust_ProfileTbl]
' 的LINQ CROSS JOIN错误
对象不能 转换为类型 '
System.Data.Entity.DbSet`1XXX.Core.Model.Cust_ProfileTbl]
'。
当我尝试CROSS JOIN
与LINQ这两个表。任何人都可以建议我应该怎么做?
var Cust_ProfileTbl = service.DBContext.Set<Cust_ProfileTbl>();
var Cust_GroupTbl = service.DBContext.Set<Cust_GroupTbl>();
var test =
from cg in Cust_GroupTbl
from c in Cust_ProfileTbl
select new { intCustGroup = cg.intCustGroup, bintAccountNo = c.bintAccountNo };
Cust_ProfileTbl.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace XXXX.Core.Model
{
[Table("Cust_ProfileTbl")]
public partial class Cust_ProfileTbl
{
[Key]
public long bintAccountNo { get; set; }
}
}
Cust_GroupTbl.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace xxxx.Core.Model
{
[Table("Cust_GroupTbl")]
public partial class Cust_GroupTbl
{
[Key]
public int intCustGroup { get; set; }
}
}