I'm not quite sure we want this, but I believe we could automatically create ProjectDbContexts scoped to a specific project per request by reading the requested projectCode from the path like so:
https://github.com/shaunluttin/asp-net-core-from-path-value-provider/blob/master/PathValueProvider.cs
If a service contains a combination of methods that access a specific project as well as ones that don't a potential solution would be to make ProjectDbContext a lazy service.
https://github.com/sillsdev/languageforge/blob/48332f3d2584fe05ac9cee44c906144c6d4d6019/backend/DataAccess/DataServiceKernel.cs#L28