Exemplo 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));
            });
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([FromBody] PrintingEditionModelItem printingEditionItem)
        {
            var printingEditionModel = await _printingEditionService.CreateAsync(printingEditionItem);

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

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