DEV Community

Discussion on: How to Display Junction Tables in .NET Core MVC 3.1

Collapse
 
mitchelln11 profile image
mitchelln11

So if I switch from MVC only to a Service-Repository pattern, how to I connect to my database? More specifically, where does my DbSet go? From the start, it's in my ApplicationDbContext class under my Data folder. Would I have to move those at all, or do I just use DI from the DbContext?

private readonly ApplicationDbContext _context;
public ParkController(ApplicationDbContext context)
{
            _context = context;

 }