示例#1
0
 /// <summary>
 /// api controller constructor
 /// </summary>
 /// <param name="_commands">Command object</param>
 /// <param name="_queries">Query object</param>
 /// <param name="_orderLogic">Order logic object</param>
 /// <param name="_mapper">Automapper</param>
 public ecomController(IOrderCommand _commands, IOrderQuery _queries, IOrderLogic _orderLogic, IMapper _mapper)
 {
     commandService = _commands;
     queryService   = _queries;
     orderLogic     = _orderLogic;
     mapper         = _mapper;
 }
 public UserDashboardModel(IOrderQuery orderQuery, IAuthHelper authHelper, IOrderApplication orderApplication, IAccountApplication accountApplication)
 {
     _orderQuery         = orderQuery;
     _authHelper         = authHelper;
     _orderApplication   = orderApplication;
     _accountApplication = accountApplication;
 }
 public OrderSetToBilledCommandHandler(
     ILogger <OrderSetToBilledCommandHandler> logger,
     IOrderQuery orderQuery,
     IOrderRepository orderRepository)
 {
     _logger          = logger;
     _orderQuery      = orderQuery;
     _orderRepository = orderRepository;
 }
示例#4
0
 public void Execute(OnOrderCreated ev)
 {
     using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MongoDb))
     {
         IOrderQuery query = IoC.Container.Resolve <IOrderQuery>(uow);
         query.Add(new App.Order.Query.Entity.Order(ev.OrderId));
         uow.Commit();
     }
 }
示例#5
0
        public void Setup()
        {
            fixture = new Fixture();
            fixture.Behaviors.OfType <ThrowingRecursionBehavior>().ToList().ForEach(b => fixture.Behaviors.Remove(b));
            fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            dbContext = new Mock <queryContext>();
            query     = new OrderQuery(dbContext.Object);
        }
 public OrderUpdateWhenCustomerAndPaymentMethodVerifiedDomainEventHandler(
     ILogger <OrderUpdateWhenCustomerAndPaymentMethodVerifiedDomainEventHandler> logger,
     IOrderRepository orderRepository,
     IOrderQuery orderQuery
     /*IMediator mediator*/)
 {
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));
     // _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));
     _orderQuery = orderQuery ?? throw new ArgumentNullException(nameof(orderQuery));
 }
示例#7
0
 public void Execute(OnOrderActivated ev)
 {
     using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MongoDb))
     {
         IOrderQuery query = IoC.Container.Resolve <IOrderQuery>(uow);
         App.Order.Query.Entity.Order order = query.GetByOrderId(ev.OrderId);
         order.IsActivated = true;
         query.Update(order);
         uow.Commit();
     }
 }
示例#8
0
 public void Execute(OnCustomerDetailChanged ev)
 {
     using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MongoDb))
     {
         IOrderQuery query = IoC.Container.Resolve <IOrderQuery>(uow);
         App.Order.Query.Entity.Order order = query.GetByOrderId(ev.OrderId);
         order.Name = ev.CustomerName;
         query.Update(order);
         uow.Commit();
     }
 }
示例#9
0
 public void Execute(OnOrderLineItemAdded ev)
 {
     using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MongoDb))
     {
         IOrderQuery query = IoC.Container.Resolve <IOrderQuery>(uow);
         App.Order.Query.Entity.Order order = query.GetByOrderId(ev.OrderId);
         order.OrderLines.Add(new OrderLine(ev.ProductId, ev.ProductName, ev.Quantity, ev.Price));
         order.TotalItems += ev.Quantity;
         order.TotalPrice += ev.Price * (decimal)ev.Quantity;
         query.Update(order);
         uow.Commit();
     }
 }
示例#10
0
 public TradeAppService(ITradeQuery queryTrade, ITradeRepository tradeRepository, IOrderQuery orderQuery,
     IOrderRepository orderRepository, ISupplierRepository supplierRepository,
     IMaterialRepository materialRepository, IActionCategoryRepository actionCategoryRepository,
     IContractAircraftRepository contractAircraftRepository, IContractEngineRepository contractEngineRepository,
     IRelatedDocRepository relatedDocRepository,IPnRegRepository pnregRepository)
 {
     _tradeQuery = queryTrade;
     _tradeRepository = tradeRepository;
     _orderQuery = orderQuery;
     _orderRepository = orderRepository;
     _supplierRepository = supplierRepository;
     _materialRepository = materialRepository;
     _actionCategoryRepository = actionCategoryRepository;
     _contractAircraftRepository = contractAircraftRepository;
     _contractEngineRepository = contractEngineRepository;
     _relatedDocRepository = relatedDocRepository;
     _pnRegRepository = pnregRepository;
 }
示例#11
0
 /// <summary>
 /// 初始化订单控制器
 /// </summary>
 /// <param name="mediator">IMediator</param>
 /// <param name="orderQuery">订单查询</param>
 public OrdersController(IMediator mediator, IOrderQuery orderQuery)
 {
     _mediator   = mediator;
     _orderQuery = orderQuery;
 }
示例#12
0
 public IndexModel(IMediator mediator,
                   IOrderQuery orderQuery)
 {
     _mediator   = mediator;
     _orderQuery = orderQuery;
 }
示例#13
0
 public OrderApplication(ICommandMediator mediatorHandler, IOrderQuery orderQuery)
 {
     this._mediatorHandler = mediatorHandler ?? throw new ArgumentNullException(nameof(mediatorHandler));
     this._orderQuery      = orderQuery ?? throw new ArgumentNullException(nameof(orderQuery));
 }
 public OrderController(IOrderCommand command, IOrderQuery query)
 {
     _command = command;
     _query   = query;
 }
 public MenuViewComponent(IOrderQuery orderQuery, ICategoryQuery categoryQuery, IArticleCategoryQuery articleCategoryQuery)
 {
     _orderQuery           = orderQuery;
     _categoryQuery        = categoryQuery;
     _articleCategoryQuery = articleCategoryQuery;
 }
示例#16
0
 /// <summary>
 /// 倒序
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <typeparam name="TResult"></typeparam>
 /// <param name="obj"></param>
 /// <param name="predicate"></param>
 /// <returns></returns>
 public static IOrderQuery <T> ThenByDescending <T, TResult>(this IOrderQuery <T> obj, Expression <Func <T, TResult> > predicate)
 {
     obj.OrderBy = $"{obj.OrderBy},{QueryableBuilder.GetPropertyName(predicate)} DESC";
     return(obj);
 }
示例#17
0
 public OrderAppService(IOrderQuery orderQuery)
 {
     _orderQuery = orderQuery;
 }
 public OrderByIdQueryHandler(ILogger <OrderByIdQueryHandler> logger, IOrderQuery orderQuery)
 {
     _logger     = logger;
     _orderQuery = orderQuery;
 }
示例#19
0
 public orderController(IOrderCommands _commands, IOrderQuery _orders, IMapper _mapper)
 {
     commandSerive = _commands;
     orderService  = _orders;
     mapper        = _mapper;
 }
示例#20
0
 public OrderLogic(IOrderQuery _queries)
 {
     queryService = _queries;
 }
示例#21
0
 public DetailModel(IMediator mediator,
                    IOrderQuery orderQuery)
 {
     _mediator   = mediator;
     _orderQuery = orderQuery;
 }
示例#22
0
        public OrderSummary GetOrder(string id)
        {
            IOrderQuery query = IoC.Container.Resolve <IOrderQuery>();

            return(query.GetOrder <OrderSummary>(id));
        }
 public OrderProvider(IOrderQuery query)
 {
     _query = query;
 }
        public IList <OrderSummaryItem> GetOrders()
        {
            IOrderQuery query = IoC.Container.Resolve <IOrderQuery>();

            return(query.GetOrders <OrderSummaryItem>());
        }
示例#25
0
 /// <summary>
 /// Initializes a new instance of the <seealso cref="OrderRepository"/> class.
 /// </summary>
 /// <param name="context">Context for accessing products</param>
 /// <param name="query">Query object for order filtering</param>
 public OrderRepository(ProductContext context, IOrderQuery query) : base(context)
 {
     _orderQuery = query;
 }
示例#26
0
 public OrderService(IOrderQuery orderQuery)
 {
     _orderQuery = orderQuery;
 }
示例#27
0
 public OrderController(IMediator mediator, INotificationHandler <ExceptionNotification> notifications, IOrderQuery orderQuery) : base(notifications)
 {
     _mediator   = mediator;
     _orderQuery = orderQuery;
 }