public async Task <ActionResult <PrintPreviewResponse> > PreviewById([FromRoute] string id, [FromBody] PrintingPreviewTemplate entity, [FromQuery] PrintEntityByIdArguments args, CancellationToken cancellation) { var result = await _service.PreviewById(id, entity, args, cancellation); // Prepare and return the response var response = new PrintPreviewResponse { Body = result.Body, DownloadName = result.DownloadName }; return(Ok(response)); }
public async Task <ActionResult <PrintPreviewResponse> > Preview([FromBody] PrintingPreviewTemplate entity, [FromQuery] PrintArguments args, CancellationToken cancellation) { args.Custom = Request.Query.ToDictionary(e => e.Key, e => e.Value.FirstOrDefault()); var result = await _service.Preview(entity, args, cancellation); // Prepare and return the response var response = new PrintPreviewResponse { Body = result.Body, DownloadName = result.DownloadName }; return(Ok(response)); }