public DashboardController(IOrderListServiceFactory orderListServiceFactory, IMapper mapper)
        {
            if (orderListServiceFactory == null)
            {
                throw new ArgumentNullException(nameof(orderListServiceFactory));
            }
            if (mapper == null)
            {
                throw new ArgumentNullException(nameof(mapper));
            }

            _mapper       = mapper;
            _orderService = orderListServiceFactory.GetDashboard();
        }
Example #2
0
        public OrdersController(IOrderListServiceFactory orderListServiceFactory, ISubmitOrderService orderSubmitService, IOrderDetailService orderDetailService, IMapper mapper)
        {
            if (orderListServiceFactory == null)
            {
                throw new ArgumentNullException(nameof(orderListServiceFactory));
            }
            if (orderSubmitService == null)
            {
                throw new ArgumentNullException(nameof(orderSubmitService));
            }
            if (orderDetailService == null)
            {
                throw new ArgumentNullException(nameof(orderDetailService));
            }
            if (mapper == null)
            {
                throw new ArgumentNullException(nameof(mapper));
            }

            _orderService       = orderListServiceFactory.GetRecentOrders();
            _orderSubmitService = orderSubmitService;
            _orderDetailService = orderDetailService;
            _mapper             = mapper;
        }