日期:2014-05-17 浏览次数:20477 次
BlogPost post = new BlogPost()
{
ID = 3560,
Title = "Title Test",
Description = "Description test",
Author = "gxingmin"
};
using (BlogDbContext context = new BlogDbContext())
{
context.BlogPosts.Attach(post);
post.Title = "Title Changed";
post.Description = "Description test";
context.SaveChanges();
}