Exemple #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 async Task <BaseResponseModel> PostAsync([FromBody] PrintingEditionModel printingEdition)
        {
            BaseResponseModel report = await _service.CreateAsync(printingEdition);

            return(report);
        }
        public async Task <IActionResult> CreateAsync(PrintingEditionsModelItem model)
        {
            var result = await _printingEditionService.CreateAsync(model);

            return(Ok(result));
        }
Exemple #4
0
        public async Task <IActionResult> Create([FromBody] PrintingEditionModelItem printingEditionItem)
        {
            var printingEditionModel = await _printingEditionService.CreateAsync(printingEditionItem);

            return(Ok(printingEditionModel));
        }
        public async Task <IActionResult> Create([FromBody] PrintingEditionModel model)
        {
            await _editionService.CreateAsync(model);

            return(Ok());
        }
Exemple #6
0
 public async Task Add([FromBody] PrintingEditionModel printingEdiotionModel)
 {
     await _printingEditionService.CreateAsync(printingEdiotionModel);
 }