我有这个功能:
public void copy(string abc)
{
var query_1 = from Book s in BookDB.Books where (s.Author == abc && s.AuthorCV != "") select s;
var query_2 = from Book x in BookDB.Books where (x.Author == abc && x.AuthorCV == "") select x;
}
我的问题是如何在query_2中将AuthorCV从query_1复制到AuthorCV ...请帮帮我
答案 0 :(得分:-1)
尝试将两个查询都转换为Book
,然后从另一个中复制,然后保留第二个:
Book book1 = (Book)query_1;
Book book2 = (Book)query_2;
book2.AuthorCV=book1.AuthorCV;
然后坚持book2
保存更改。