780 B
780 B
MVC-SimpleCRUD-Layered
This solution keeps the behavior of MVC-SimpleCRUD, but separates the code into a simple layered architecture:
MVC-SimpleCRUD-Layered.Webcontains controllers, Razor views, tag helpers, static files, and UI concerns.MVC-SimpleCRUD-Layered.Applicationcontains application models and theIPeopleService/PeopleServiceuse-case logic.MVC-SimpleCRUD-Layered.Datacontains EF Core generated models andEventsContextimplementations.
Request flow:
Browser -> PeopleController -> IPeopleService -> EventsContext -> Database
The main teaching contrast is that controllers no longer use EventsContext directly. They receive HTTP input, handle MVC concerns, and delegate the person CRUD workflow to the application layer.