代码如下:

  

var query = from s in db.LoginUserServices
							join ss in db.Services on s.ServiceType equals ss.Code into s_ss_join
							from s_ss in s_ss_join.DefaultIfEmpty()
							where s.LoginUserID.Equals(LoginUserID) 
							select new
							{
								// ServiceType = s.ServiceType,
								ServiceName = s_ss.Name,
								ServiceProperty = s_ss.Property,
								ServiceCode = s.ServiceType
							};

 Linq to Array中报错:

报错位置:

Equals

改为:

var query = from s in db.LoginUserServices
							join ss in db.Services on s.ServiceType equals ss.Code into s_ss_join
							from s_ss in s_ss_join.DefaultIfEmpty()
							where s.LoginUserID==LoginUserID 
							select new
							{
								// ServiceType = s.ServiceType,
								ServiceName = s_ss.Name,
								ServiceProperty = s_ss.Property,
								ServiceCode = s.ServiceType
							};

 

 

  

相关文章:

  • 2022-01-12
  • 2021-05-31
  • 2021-08-03
  • 2021-08-29
  • 2022-12-23
  • 2021-05-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-02-10
相关资源
相似解决方案