Beispiel #1
0
        public ActionResult Save()
        {
            var province = new Province()
            {
                Population = 3000000,
                Name       = "BeiJing",
            };

            var province1 = new Province()
            {
                Population = 1000000,
                Name       = "jiangsu",
            };

            var company = new Company()
            {
                Name          = "Augumentum",
                EstablishDate = DateTime.Now,
                LegalPerson   = "zack",
            };


            using (var dbScope = _dbContextScopeFactory.CreateWithTransaction(IsolationLevel.ReadCommitted))
            {
                _provinceRepository.BulkInsert(new List <Province>
                {
                    province, province1
                });

                dbScope.SaveChanges();
            }



            return(Ok());
        }