I’m trying to work on a design for a Blazor Server application for enterprise where I have one project that contains UI, Services, etc for the entire application, and modular pieces different developers can use with Razor Class Libraries and an attached Data project. Ideally I’d use a web api for data access but am currently restricted to using EFCore 8 directly in the Data project.
My current setup is
project.ui, project.shared, project.auth, project.tests
My RCL setup is
rcl.ui, rcl.data, rcl.tests
I reference the .shared project in both the ui of the project and rcl.data so I can share classes and potentially the dbcontext factory. Each .data project from the RCL would have it’s own DBContext.
I’m trying to have a DBContextFactory registered in my project.ui that I can .CreateContext and use the context of the rcl.data for data access in rcl.ui.
It’s all one sql connection the only change is different database by department. Each context would have a track of tables, etc.
Is there a logic way to do this? If not, are there other options?