ling 中Contains为什么报异常

这是代码:

    List<Guid>list = new List<Guid>();

 var info = from businessUnit in context.CreateQuery<BusinessUnit>()

                               join user1 in context.CreateQuery<crm_User>()

                               on businessUnit.BusinessUnitId equals user1.crm_businessunit_id.Id

                               where list.Contains(businessUnit.BusinessUnitId.Value)

                               select new
                               {
                                  BusinessUnitId = businessUnit.BusinessUnitId,

                                   userName = user1.crm_name,

                                   buName = businessUnit.Name
                               };
幕布斯7119047
浏览 474回答 5
5回答

有只小跳蛙

Guid转为string试试。我想是不是Guid不能这样比较。

largeQ

报什么错呢?你的businessUnit.BusinessUnitId.Value不是Guid?

白衣染霜花

不是,因该是上个页面传过来的!
打开App,查看更多内容
随时随地看视频慕课网APP