我正在尝试附加到某个字段,但是当我尝试以下操作时,现有数据(Update.Comments)会被followUpComments覆盖,而不是附加到它。
我如何追加?
using (var context = new DBContext()){
var Update = (from p in context.Prospects where p.id == recordIdToUpdate select p).Single();
Update.Comments = Update.Comments + "\n\n" +followUpComments;
context.SaveChanges();
}
答案 0 :(得分:0)
使用String.Concat而不是+ operator