From 755d556f097789f662c43902f5fb59d40138a6f8 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 23 Dec 2022 21:20:41 +0300 Subject: [PATCH] Delete SkuExtensions class --- src/Models/SkuExtensions.cs | 12 ------------ src/Models/SourcePriceList.cs | 2 +- src/RhSolutions.csproj | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 src/Models/SkuExtensions.cs diff --git a/src/Models/SkuExtensions.cs b/src/Models/SkuExtensions.cs deleted file mode 100644 index 160dc16..0000000 --- a/src/Models/SkuExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Text.RegularExpressions; - -namespace RhSolutions.Models -{ - static class SkuExtensions - { - public static bool IsRehauSku(this string line) - { - return Regex.IsMatch(line, @"^[1]\d{6}[1]\d{3}$"); - } - } -} \ No newline at end of file diff --git a/src/Models/SourcePriceList.cs b/src/Models/SourcePriceList.cs index d210c10..ed860b4 100644 --- a/src/Models/SourcePriceList.cs +++ b/src/Models/SourcePriceList.cs @@ -87,7 +87,7 @@ namespace RhSolutions.Models if (group == null || name == null || sku == null) continue; - if (!sku.ToString().IsRehauSku()) + if (!Sku.TryParse(sku.ToString(), out _)) continue; Product p = new Product diff --git a/src/RhSolutions.csproj b/src/RhSolutions.csproj index d88943e..c46d489 100644 --- a/src/RhSolutions.csproj +++ b/src/RhSolutions.csproj @@ -83,7 +83,6 @@ -