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(); } } }