Exemplo n.º 1
0
 internal TResult Perform <TResult>(
     IPerformableAction <TResult> action,
     bool transactional = true)
 {
     if (transactional)
     {
         using (IBillingContext context = BillingContext.Create())
         {
             using (var transaction = TransactionUtils.CreateTransaction())
             {
                 action.DbContext = context;
                 TResult result = action.Perform();
                 transaction.Complete();
                 return(result);
             }
         }
     }
     else
     {
         using (IBillingContext context = BillingContext.Create())
         {
             action.DbContext = context;
             return(action.Perform());
         }
     }
 }
Exemplo n.º 2
0
 internal void  Perform(
     IPerformableAction action,
     bool transactional = true)
 {
     if (transactional)
     {
         using (IBillingContext context = BillingContext.Create())
         {
             using (var transaction = TransactionUtils.CreateTransaction())
             {
                 action.DbContext = context;
                 action.Perform();
                 transaction.Complete();
             }
         }
     }
     else
     {
         using (IBillingContext context = BillingContext.Create())
         {
             action.DbContext = context;
             action.Perform();
         }
     }
 }
Exemplo n.º 3
0
 public BillingRepository(IBillingContext context)
 {
     Context = context;
 }
Exemplo n.º 4
0
 public ShopController(IProductContext productContext, IReviewContext reviewContext, IOrderContext orderContext, IBillingContext billingContext)
 {
     productLogic = new ProductLogic(productContext);
     reviewLogic  = new ReviewLogic(reviewContext);
     orderLogic   = new OrderLogic(orderContext);
     billingLogic = new BillingLogic(billingContext);
 }
Exemplo n.º 5
0
 public BillingLogic(IBillingContext context)
 {
     BillingRepository = new BillingRepository(context);
 }
Exemplo n.º 6
0
 public BillingManager(IBillingContext context)
     : base(context)
 {
 }
Exemplo n.º 7
0
 protected BaseManager(IBillingContext context)
 {
     this.Context = context;
 }