[英]How to assign one object to another in Linq c# without making new
我在将Linq中的一个对象分配给另一个对象时遇到了问题。 在此示例中:
Func<result, result> make = q => new result
{
Id = q.Id,
lName = q.lName,
GroupId = q.GroupId,
Age = (from tags in q.age where tags.Del == null && tags.lId == q.Id select age).ToEntitySet(),
};
p = (from q in dc.results
where q.Id == Id.Value
select make(q)).First();
我正在制作新对象并分配该对象,但是我不想这样做,这会导致插入问题。 我想分配而不创建新对象,这怎么可能?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.