From 402ffae02d2ee0c48e8220500c03e588a5d57f15 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Sun, 18 Dec 2022 11:58:29 +0300 Subject: [PATCH] Fix Post method exception --- .../Controllers/ProductsController.cs | 2 +- RhSolutions.Api/Services/ClosedXMLParser.cs | 20 ------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/RhSolutions.Api/Controllers/ProductsController.cs b/RhSolutions.Api/Controllers/ProductsController.cs index d7d1082..21bd8e2 100644 --- a/RhSolutions.Api/Controllers/ProductsController.cs +++ b/RhSolutions.Api/Controllers/ProductsController.cs @@ -45,7 +45,7 @@ namespace RhSolutions.Api.Controllers } dbContext.SaveChanges(); - return Ok(products); + return Ok(); } catch (Exception ex) { diff --git a/RhSolutions.Api/Services/ClosedXMLParser.cs b/RhSolutions.Api/Services/ClosedXMLParser.cs index 1a74528..2af9afb 100644 --- a/RhSolutions.Api/Services/ClosedXMLParser.cs +++ b/RhSolutions.Api/Services/ClosedXMLParser.cs @@ -5,19 +5,6 @@ namespace RhSolutions.Api.Services { public class ClosedXMLParser : IPricelistParser { - // HttpContext? context; - // XLWorkbook? wb; - - // public ClosedXMLParser(IHttpContextAccessor accessor) - // { - // this.context = accessor.HttpContext; - // } - - // public void Dispose() - // { - // wb?.Dispose(); - // } - public async IAsyncEnumerable GetProducts(HttpContext context) { using (var memoryStream = new MemoryStream()) @@ -45,13 +32,6 @@ namespace RhSolutions.Api.Services } } } - - // private async Task GetWorkbook(HttpContext context) - // { - // using var memoryStream = new MemoryStream(); - // return ; - // } - private IXLTable GetTable(XLWorkbook wb) { var ws = wb.Worksheets.First();