The steps
- The original project was MVC Classic, with the domain layer in the same project as the MVC UI. Unit tests for the domain layer were in a separate test project.
- Introduce the abstraction. The domain layer moved into its own project behind a clear interface. The unit tests showed it still behaved the same.
- Point the existing UI at it. The MVC Classic UI was changed to depend on the new domain project.
- Reuse it for more UIs:
- a hybrid UI (MVC/Razor Pages hosting Blazor components);
- a Blazor Server UI.
Projects before and after
Three front ends, one core
The same application layer (models, repository, services, validation) in Timesheet.Core, used by three different UIs:
-
MVC Classic Controllers and Razor views, full page posts. Also has Microsoft Entra ID sign-in.
-
Blazor Server Interactive components over a SignalR connection, no page reloads.
-
MVC + Razor Componentsyou are here MVC pages hosting Blazor components (abandoned experiment).
How it's built
- C# .NET, on Azure App Service.
- Each front end has its own Azure DevOps pipeline that runs the unit tests, then deploys.
- Data is held in memory, so changes last only while the app is running.
- Git repository on Azure DevOps