Esempio n. 1
0
        public PrintingEditionGraphMutation(IPrintingEditionService printingEditionService)
        {
            FieldAsync <PrintingEditionGraphType>("add",
                                                  arguments: new QueryArguments(new QueryArgument <PrintingEditionInputGraphType> {
                Name = "printingEdition"
            }),
                                                  resolve: async(context) =>
            {
                var printingEdition = context.GetArgument <PrintingEditionModel>("printingEdition");
                return(await printingEditionService.CreateAsync(printingEdition));
            });

            FieldAsync <PrintingEditionGraphType>("edit",
                                                  arguments: new QueryArguments(new QueryArgument <PrintingEditionInputGraphType> {
                Name = "printingEdition"
            }),
                                                  resolve: async(context) =>
            {
                var printingEdition = context.GetArgument <PrintingEditionModel>("printingEdition");
                return(await printingEditionService.EditAsync(printingEdition));
            });

            FieldAsync <StringGraphType>("remove",
                                         arguments: new QueryArguments(new QueryArgument <StringGraphType> {
                Name = "id"
            }),
                                         resolve: async(context) =>
            {
                var id = context.GetArgument <string>("id");
                return(await printingEditionService.RemoveAsync(id));
            });
        }
 public PrintingStoreController(IPrintStoreService printStoreService, IPrintingEditionService printingEditionService, IAuthorService authorService, IOrderService orderService)
 {
     _orderService           = orderService;
     _printStoreService      = printStoreService;
     _printingEditionService = printingEditionService;
     _authorService          = authorService;
 }
 public AdminController(IAuthorService authorService,
                        IPrintingEditionService printingEditionService,
                        IAdminService adminService,
                        IApplicationUserService applicationUserService)
 {
     _authorService          = authorService;
     _printingEditionService = printingEditionService;
     _applicationUserService = applicationUserService;
     _adminService           = adminService;
 }
Esempio n. 4
0
 public OrderService(IMapper mapper, IPrintingEditionService printingEditionService, IOptions <UrlConfig> urlConfig, ICurrencyConvertionProvider currencyConverter, IOrderRepository orderRepository, IOrderItemRepository orderItemRepository, IPaymentRepository paymentRepository, IValidationProvider validationProvider)
 {
     _urlConfig              = urlConfig.Value;
     _orderRepository        = orderRepository;
     _itemRepository         = orderItemRepository;
     _paymentRepository      = paymentRepository;
     _printingEditionService = printingEditionService;
     _currencyConverter      = currencyConverter;
     _mapper    = mapper;
     _validator = validationProvider;
 }
        public PrintingEditionGraphQuery(IPrintingEditionService printingEditionService)
        {
            _printingEditionService = printingEditionService;

            FieldAsync <PrintingEditionGraphType>(name: "get",
                                                  arguments: new QueryArguments(new QueryArgument <StringGraphType> {
                Name = "id"
            }),
                                                  resolve: async(context) =>
            {
                var id = context.GetArgument <string>("id");
                return(await _printingEditionService.GetByIdAsync(id.ToString()));
            });


            FieldAsync <PrintingEditionResponseGraphType>("filter",
                                                          arguments: new QueryArguments(new QueryArgument <PrintingEditionRequestGraphType> {
                Name = "filter"
            }),
                                                          resolve: async(context) =>
            {
                var filter = context.GetArgument <PrintingEditionsRequestModel>("filter");
                var result = await _printingEditionService.FilterAsync(filter);
                return(result);
            });

            FieldAsync <DecimalGraphType>("convertCurrency",
                                          arguments: new QueryArguments(
                                              new QueryArgument <StringGraphType> {
                Name = "currentCurrency"
            },
                                              new QueryArgument <StringGraphType> {
                Name = "newCurrency"
            }
                                              ),
                                          resolve: async(context) =>
            {
                var currentCurrency = context.GetArgument <string>("currentCurrency");
                var newCurrency     = context.GetArgument <string>("newCurrency");
                return(await _printingEditionService.GetConvertRateAsync(currentCurrency, newCurrency));
            });
        }
Esempio n. 6
0
 public AddPrintingEditionModel(IPrintingEditionService printingEditionService, IAuthorService authorService)
 {
     _printingEditionService = printingEditionService;
     _authorService          = authorService;
 }
Esempio n. 7
0
 public PrintingEditionController(IPrintingEditionService service)
 {
     _service = service;
 }
Esempio n. 8
0
 public GetPrintingEditionsModel(IPrintingEditionService printingEditionService)
 {
     _printingEditionService = printingEditionService;
 }
Esempio n. 9
0
 public PrintingEditionController(IPrintingEditionService editionService, IUriService uriService)
 {
     _editionService = editionService;
     _uriService     = uriService;
 }
 public PrintingEditionController(IPrintingEditionService printingEditionService)
 {
     _printingEditionService = printingEditionService;
 }
 public PrintingEditionController(IPrintingEditionService editionService)
 {
     _editionService = editionService;
 }
Esempio n. 12
0
 public ValuesController(IPrintingEditionService printionEditionService)
 {
     _printionEditionService = printionEditionService;
 }