From 491ef8fdcda638c58ac2e4062260c7d39964086e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=ABl=20Mugnier?= Date: Thu, 5 Nov 2020 09:16:07 +0100 Subject: [PATCH] Fix - Correction de la recherche de tag pour l'import de produits --- .../Commands/ProductCommandsHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs b/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs index 4014d7836..648d795d0 100644 --- a/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs +++ b/Sheaft.Application.Handlers/Commands/ProductCommandsHandler.cs @@ -363,7 +363,7 @@ private async Task> CreateProductCommandFromRowData var conditioningStr = worksheet.Cells[i, 5].GetValue()?.ToLowerInvariant().Replace("\"", "").Replace("'", "").Replace(".", ",").Split(",").Select(t => t.Trim()).FirstOrDefault(); var quantityPerUnitStr = worksheet.Cells[i, 6].GetValue()?.ToLowerInvariant().Replace(" ", "").Replace(",", "."); var unitKindStr = worksheet.Cells[i, 7].GetValue()?.ToLowerInvariant().Replace(" ", "").Replace(",", ".").Split(",").Select(t => t.Trim()).FirstOrDefault(); - var tagsStr = worksheet.Cells[i, 8].GetValue()?.ToLowerInvariant().Replace("\"", "").Replace("'", "").Replace(".", ",").Split(",").Select(t => t.Trim()).FirstOrDefault(); + var tagsStr = worksheet.Cells[i, 8].GetValue()?.Replace("\"", "").Replace("'", "").Replace(".", ",").Split(",").Select(t => t.Trim()).FirstOrDefault(); var bioStr = worksheet.Cells[i, 9].GetValue()?.ToLowerInvariant().Replace(" ", ""); if (!decimal.TryParse(wholeSalePriceStr, NumberStyles.Any, new CultureInfo("en-US"), out decimal wholeSalePrice)) @@ -420,7 +420,7 @@ private async Task> CreateProductCommandFromRowData var tagsAsStr = tagsStr.Split(";").ToList(); - var tags = await _context.FindAsync(t => tagsAsStr.Any(c => c == t.Name.ToLowerInvariant()), token); + var tags = await _context.FindAsync(t => tagsAsStr.Contains(t.Name), token); createProductCommand.Tags = tags.Select(t => t.Id); createProductCommand.Available = false;