run-aspnetcore-microservices icon indicating copy to clipboard operation
run-aspnetcore-microservices copied to clipboard

Refactor- name of the product going to be unique, why have to declare ToList ?

Open Jeevananthan-23 opened this issue 3 years ago • 0 comments

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();
       }

Jeevananthan-23 avatar Dec 29 '21 10:12 Jeevananthan-23