From 28c472364ba6a84641f68d07192b7777a313d588 Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Tue, 28 Jan 2025 05:17:35 +0300 Subject: Add search keys --- RhSolutions.ProductSku/ProductExtensions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 RhSolutions.ProductSku/ProductExtensions.cs (limited to 'RhSolutions.ProductSku/ProductExtensions.cs') diff --git a/RhSolutions.ProductSku/ProductExtensions.cs b/RhSolutions.ProductSku/ProductExtensions.cs new file mode 100644 index 0000000..3976581 --- /dev/null +++ b/RhSolutions.ProductSku/ProductExtensions.cs @@ -0,0 +1,9 @@ +namespace RhSolutions.Models; + +public static class ProductExtensions +{ + public static IEnumerable FilterByName(this IEnumerable products, string[] searchKeys) + { + return products.Where(p => searchKeys.Any(k => p.Name.Contains(k))); + } +} \ No newline at end of file -- cgit v1.2.3