aspnetrun / run-aspnetcore-microservices

Microservices on .Net platforms which used ASP.NET Web API, Docker, RabbitMQ, MassTransit, Grpc, Yarp API Gateway, PostgreSQL, Redis, SQLite, SqlServer, Marten, Entity Framework Core, CQRS, MediatR, DDD, Vertical and Clean Architecture implementation with using latest features of .NET 8 and C# 12
https://www.udemy.com/course/microservices-architecture-and-implementation-on-dotnet/?couponCode=JUNE24
MIT License
2.53k stars 1.38k forks source link

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

Closed Jeevananthan-23 closed 1 year ago

Jeevananthan-23 commented 2 years ago
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();
        }