MCPcopy Create free account
hub / github.com/TryCatchLearn/Restore-v2 / Search

Method Search

API/Extensions/ProductExtensions.cs:20–27  ·  view source on GitHub ↗
(this IQueryable<Product> query, string? searchTerm)

Source from the content-addressed store, hash-verified

18 }
19
20 public static IQueryable<Product> Search(this IQueryable<Product> query, string? searchTerm)
21 {
22 if (string.IsNullOrEmpty(searchTerm)) return query;
23
24 var lowerCaseSearchTerm = searchTerm.Trim().ToLower();
25
26 return query.Where(x => x.Name.ToLower().Contains(lowerCaseSearchTerm));
27 }
28
29 public static IQueryable<Product> Filter(this IQueryable<Product> query,
30 string? brands, string? types) {

Callers 1

GetProductsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected