コード例 #1
0
        public void Save(PaymentOptionDTO paymentOption)
        {
            using (var db = new Context())
            {
                using (var transaction = db.Database.BeginTransaction())
                {
                    var paymentOptionToSave = PaymentOption.FromDto(paymentOption);
                    db.PaymentOption.AddOrUpdate(paymentOptionToSave);

                    db.SaveChanges();
                    transaction.Commit();
                }
            }
        }