C# LINQ交叉连接错误

C# LINQ交叉连接错误,c#,sql,linq,C#,Sql,Linq,我犯了这个错误 “System.Data.Objects.ObjectQuery`1[XXX.Model.Cust\u ProfileTbl]类型的对象不能 转换为类型 “System.Data.Entity.DbSet`1XXX.Core.Model.Cust_ProfileTbl]” 当我尝试使用LINQ交叉连接这两个表时。谁能告诉我该怎么办 var Cust_ProfileTbl = service.DBContext.Set<Cust_ProfileTbl>(); var C

我犯了这个错误

System.Data.Objects.ObjectQuery`1[XXX.Model.Cust\u ProfileTbl]
类型的对象不能 转换为类型 “
System.Data.Entity.DbSet`1XXX.Core.Model.Cust_ProfileTbl]

当我尝试使用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 };
客户群TBL.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; } 
    }
}
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; } 
    }
}
var test =
from cg in service.DBContext.Cust_GroupTbls
from c in service.DBContext.Cust_ProfileTbls
select new { intCustGroup = cg.intCustGroup, bintAccountNo = c.bintAccountNo };