Skip to content

Create project db context automatically for requested project #2

Description

@myieye

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions