Skip to content

Commit 68e6d74

Browse files
committed
search criteria fixed
1 parent 5e55cb5 commit 68e6d74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AspNetRunBasic/Repositories/ProductRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task<IEnumerable<Product>> GetProductByNameAsync(string name)
3333
{
3434
return await _dbContext.Products
3535
.Include(p => p.Category)
36-
.Where(p => p.Name.Contains(name) || string.IsNullOrEmpty(name))
36+
.Where(p => string.IsNullOrEmpty(name) || p.Name.ToLower().Contains(name.ToLower()))
3737
.OrderBy(p => p.Name)
3838
.ToListAsync();
3939
}

0 commit comments

Comments
 (0)