.NET Core 中 Z.EntityFramework.Plus 更新表字段问题

代码小屋 其他问答 1

请问在 .NET Core 中是否可以通过 Z.EntityFramework.Plus 实现下面的更新

UPDATE BlogSite
SET PostCount = PostCount + 1
WHERE BlogId = @BlogId

回复

共1条回复 我来回复
  • 源码驿站
    这个人很懒,什么都没有留下~
    评论

    db.BlogSite.Where(t => t.BlogId == BlogId).Update(t => new BlogSite { PostCount =t.PostCount +1 });

    0条评论

发表回复

登录后才能评论