run-aspnetcore-microservices
run-aspnetcore-microservices copied to clipboard
Refactor- name of the product going to be unique, why have to declare ToList ?
public async Task<IEnumerable<Product>> GetProductByName(string name)
{
FilterDefinition<Product> filter = Builders<Product>.Filter.ElemMatch(p => p.Name, name);
return await _context
.Products
.Find(filter)
.ToListAsync();
}