我有大约30个属性的userObject。如何使用linq更新对象?
我从服务器获取一个更新的userObject,只设置那些已经改变的属性,并将其余的设置为null。
我目前正在使用一个foreach和chk从服务器的值不是null然后更新它。有没有办法只是更新使用LINQ非空的单元格?
LINQ到对象
public class UserProfile
{
public string string00 { get; set; }
public string string01 { get; set; }
public string string02 { get; set; }
public string string03 { get; set; }
public string string04 { get; set; }
public boolean bool00 { get; set; }
public boolean bool01 { get; set; }
public boolean bool02 { get; set; }
public boolean bool03 { get; set; }
public boolean bool04 { get; set; }
}
LINQ到什么地步? LINQ到对象? LINQ to SQL?实体框架? – Steven
您可以发布您现在使用的代码吗? – dasblinkenlight