jjzjj

customerProfileId

全部标签

c# - 运算符 '==' 不能应用于 linq to entity 中类型为 'System.Guid' 和 'string' 的操作数

我在linqtoentityframework代码下方收到此错误“运算符‘==’无法应用于‘System.Guid’和‘string’类型的操作数”。在下面的代码中,CustomerId是Guid,customerProfileId是字符串。varaccountQuery=fromCinCustomerModel.CustomerProfilewhereC.CustomerId==customerProfileId//ErrorhereselectC; 最佳答案 您不能直接将Guid与字符串进行比较。将字符串转换为Guid或将Gui