public async Task <IActionResult> CreateProductAsync([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "products")] HttpRequestMessage request) { var createProductRequest = await requestReader.ReadModelAsync <CreateProductRequest>(request); var operation = await createProductService.ExecuteAsync(createProductRequest); if (!operation.Status) { return new ObjectResult(operation.Error) { StatusCode = (int)HttpStatusCode.InternalServerError } } ; return(new AcceptedResult()); } }