0
我尝试使用带有linq的存储过程。通过使用存储过程,Linq数据不能为空
如果result.FirstOrDefault().CustomerName
是空的,我得到下面的异常,
的NullReferenceException是不设置到对象的实例
用下面的代码未处理
对象引用:
var result = context.sp_CustomerInformation(CustomerId).ToList();
var MyCustomerName = result.FirstOrDefault().CustomerName;
我哪里错了?
感谢您的时间。 –