标签:begin class save 简单 logs change contex htm pre
using (var context = new BloggingContext()) { using (var transaction = context.Database.BeginTransaction()) { context.Blogs.Add(new Blog {Url = "http://www.zyiz.net/xilie-293.html"}); context.SaveChanges(); context.Blogs.Add(new Blog {Url = "http://www.zyiz.net/"}); context.SaveChanges(); transaction.Commit(); } }
比较简单,记录下,以备不时只需。
标签:begin class save 简单 logs change contex htm pre
原文地址:https://www.cnblogs.com/puzi0315/p/12597218.html