NorthwindTraders
NorthwindTraders copied to clipboard
Application layer access to DbContext?
Hi all. Is it correct the Hadler in Application access the DB Context in Clean Architecture aproach?
public async Task<ProductsListVm> Handle(GetProductsListQuery request, CancellationToken cancellationToken)
{
var products = await _context.Products
.ProjectTo<ProductDto>(_mapper.ConfigurationProvider)
.OrderBy(p => p.ProductName)
.ToListAsync(cancellationToken)
}
He is using INorthwindDbContext to access EF implementation, so it's correct, but I prefer to use the repository pattern.
Thank you for your interest in this project. This repository has been archived and is no longer actively maintained or supported. We appreciate your understanding. Feel free to explore the codebase and adapt it to your own needs if it serves as a useful reference. If you have any further questions or concerns, please refer to the README for more information.