diff options
Diffstat (limited to 'RhSolutions.ProductSku/ProductExtensions.cs')
-rw-r--r-- | RhSolutions.ProductSku/ProductExtensions.cs | 9 |
1 files changed, 9 insertions, 0 deletions
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<Product> FilterByName(this IEnumerable<Product> products, string[] searchKeys) + { + return products.Where(p => searchKeys.Any(k => p.Name.Contains(k))); + } +}
\ No newline at end of file |