Asp.net Linq查询抛出异常

时间:2012-12-17 06:12:22

标签: c# asp.net linq

错误详情: 无法创建类型为“Huntable.Data.MasterEmployee”的常量值。在此上下文中仅支持原始类型或枚举类型。

IList<MasterEmployee> masterEmployees = sizeIds
    .Select(followerId => MasterDataManager.AllEmployees
    .Single(x => x.Id == followerId)).ToList(); 
rspdata.DataSource = CompanyManager.GetCompanyJobs(masterEmployees); 

IList<Company> companies = new List<Company>();
IQueryable<IGrouping<string, Job>> job = from c in context.Jobs
    group c by c.CompanyName;
IList<string> comapnyname= (
    from gro in job 
    from masterEmployee in sizeids 
    where gro.Count() >= masterEmployee.Min 
       && gro.Count() <= masterEmployee.Max select gro.Key).ToList();
var companiesList = companies.ToList();

公司名称行获得以下异常。

0 个答案:

没有答案