public static void DisableAutoDetectChanges(this IPaymentContext context, bool disable = true) { if (context is DbContext dbContext) { dbContext.ChangeTracker.AutoDetectChangesEnabled = !disable; } }
public DataPushService(IPaymentContext context, IXrmService xrmService, ILogger logger) { this.logger = logger; this.context = context; this.xrmService = xrmService; this.entityType = new List <Type>(); }
public GetPaymentHandler( IMapper mapper, IPaymentContext context) { _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _context = context ?? throw new ArgumentNullException(nameof(context)); }
public CreatePayments(IPaymentProcessorGateway gateway, IPaymentContext db, ILogger <CreatePayments> logger, IOptions <TestDataOption> options) { this.logger = logger; this.gateway = gateway; this.db = db; this.option = options.Value; }
public ProductService(ICommerceContext commerceContext, IUserManager <GearUser> userManager, IPaymentContext paymentContext, IOrderDbContext orderDbContext) { Context = commerceContext; _userManager = userManager; _paymentContext = paymentContext; _orderDbContext = orderDbContext; }
public SendPaymentRequestHandler( IBankingService bankingService, IMapper mapper, IPaymentContext context) { _bankingService = bankingService ?? throw new ArgumentNullException(nameof(bankingService)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _context = context ?? throw new ArgumentNullException(nameof(context)); }
internal GatewayContext(IShippingContext shipping, ITaxationContext taxation, IPaymentContext payment) { Mandate.ParameterNotNull(shipping, "shipping"); Mandate.ParameterNotNull(taxation, "taxation"); Mandate.ParameterNotNull(payment, "payment"); _shipping = shipping; _taxation = taxation; _payment = payment; }
public CrmReportService( IUserManager <GearUser> userManager, ITaskManagerContext taskManagerContext, ILeadContext <Lead> leadContext, IPaymentContext paymentContext) { //_context = context; _userManager = userManager; _taskManagerContext = taskManagerContext; _leadContext = leadContext; _paymentContext = paymentContext; }
internal static EventProduct GetEventProductFromId(Guid entityId, IPaymentContext context) { var eventProduct = context.EventProduct.FirstOrDefault(ep => ep.EventProductId == entityId); if (eventProduct == null) { throw new Exception("Could not find Event Product with Id:" + entityId); } return(eventProduct); }
internal static EventSponsorship GetEventSponsorshipFromId(Guid entityId, IPaymentContext context) { var eventSponsorship = context.EventSponsorship.FirstOrDefault(es => es.EventSponsorshipId == entityId); if (eventSponsorship == null) { throw new Exception("Could not find Event Sponsorship with Id:" + entityId); } return(eventSponsorship); }
public PaymentService(IPaymentContext context, IMapper mapper, ICrmOrganizationService organizationService, IProductService productService, INotify <GearRole> notifyService) { _context = context; _mapper = mapper; _organizationService = organizationService; _productService = productService; _notifyService = notifyService; }
public static async Task SaveChangesAsync(this IPaymentContext context, TimeSpan timeout, CancellationToken token = default) { if (context is DbContext dbContext) { var tempTimeout = dbContext.Database.GetCommandTimeout(); dbContext.Database.SetCommandTimeout(timeout); await dbContext.SaveChangesAsync(token); dbContext.Database.SetCommandTimeout(tempTimeout); } else { await context.SaveChangesAsync(token); } }
internal static List <EventPackage> GetEventPackagesFromEventTicket(EventTicket eventTicket, IPaymentContext context) { var eventPackages = new List <EventPackage>(); // get the list of all Tickets associated with this record var tickets = context.Ticket.Where(t => t.EventTicketId == eventTicket.EvenTicketId && t.StateCode == 0).ToList(); // get Event Packages from the Tickets foreach (var curTicket in tickets) { if (curTicket.EventPackageId.HasValue) { var curEventPackages = context.EventPackage.Where(e => e.EventPackageId == curTicket.EventPackageId && e.StateCode == 0).Distinct().ToList(); eventPackages.AddRange(curEventPackages); } } return(eventPackages); }
public PaymentRepository(IPaymentContext context) { _context = context; }
/// <summary> /// Initializes a new instance of the <see cref="PaymentGatewayApiController"/> class. /// </summary> /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param> public PaymentGatewayApiController(MerchelloContext merchelloContext) : base(merchelloContext) { _paymentContext = MerchelloContext.Gateways.Payment; }
/// <summary> /// Initializes a new instance of the <see cref="PaymentGatewayApiController"/> class. /// </summary> /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param> public PaymentGatewayApiController(IMerchelloContext merchelloContext) : base(merchelloContext) { _paymentContext = MerchelloContext.Gateways.Payment; }
public PaymentRepoService(IPaymentContext context) { this.context = context; this.context.DisableAutoDetectChanges(); }
public PaymentCodeService(IPaymentContext context, IMapper mapper) { _context = context; _mapper = mapper; }
internal static List <EventPackage> GetEventPackagesFromEventSponsorship(EventSponsorship eventSponsorship, IPaymentContext context) { var eventPackages = new List <EventPackage>(); // get the list of all Sponsorships associated with this record var sponsorships = context.Sponsorship.Where(t => t.EventSponsorshipId == eventSponsorship.EventSponsorshipId && t.StateCode == 0).ToList(); // get Event Packages from the Products foreach (var curSponsorship in sponsorships) { if (curSponsorship.EventPackageId.HasValue) { var curEventPackages = context.EventPackage.Where(e => e.EventPackageId == curSponsorship.EventPackageId && e.StateCode == 0).Distinct().ToList(); eventPackages.AddRange(curEventPackages); } } return(eventPackages); }
public PaymentService(IPaymentContext paymentContext, IOrderProductService <Order> orderProductService) { _paymentContext = paymentContext; _orderProductService = orderProductService; }
public PaymentController(IPaymentContext paymentManager, IOrderManager orderManager) { _paymentContext = paymentManager; _orderManager = orderManager; }