{"id":21013976,"url":"https://github.com/brianlparker/multitenantdbcontext","last_synced_at":"2025-06-25T17:09:00.558Z","repository":{"id":210363696,"uuid":"726294976","full_name":"BrianLParker/MultiTenantDbContext","owner":"BrianLParker","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-02T13:12:49.000Z","size":198,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T16:22:47.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrianLParker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-02T01:03:06.000Z","updated_at":"2023-12-02T13:23:38.000Z","dependencies_parsed_at":"2024-11-19T09:47:52.030Z","dependency_job_id":"81d3e9d0-8cfa-4522-8ab1-96f7407c038b","html_url":"https://github.com/BrianLParker/MultiTenantDbContext","commit_stats":null,"previous_names":["brianlparker/multitenantdbcontext"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BrianLParker/MultiTenantDbContext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianLParker%2FMultiTenantDbContext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianLParker%2FMultiTenantDbContext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianLParker%2FMultiTenantDbContext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianLParker%2FMultiTenantDbContext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrianLParker","download_url":"https://codeload.github.com/BrianLParker/MultiTenantDbContext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianLParker%2FMultiTenantDbContext/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261917439,"owners_count":23229918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:44:41.424Z","updated_at":"2025-06-25T17:09:00.525Z","avatar_url":"https://github.com/BrianLParker.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MultiTenantDbContext\n\nHow I generated the Migrations and Optimizations\n\n`ApplicationDbContext`\n```\nAdd-Migration -Context ApplicationDbContext CreateInitialIdentitySchema -OutputDir Data/Migrations/IdentityContext\nOptimize-DbContext -Context ApplicationDbContext -OutputDir Data/Optimizations/IdentityContext\n```\n\n`TenantDbContext`\n```\nAdd-Migration -Context TenantDbContext CreateInitialTenantSchema -OutputDir Data/Migrations/TenantContext\nOptimize-DbContext -Context TenantDbContext -OutputDir Data/Optimizations/TenantContext\n```\n\n\nThis will create ApplicationDbContext for all users. \n```\nUpdate-Database -Context ApplicationDbContext\n```\n\nThere is no point doing this for tenant database as it has a dynamic connection string.\nWhen the user navigates to the Tenant Data the service will create the Tenant Database if not initialized.\n\n`appsettings.json`\n```js\n  \"Tenants\": [\n    \"TenantA\",\n    \"TenantB\",\n    \"TenantC\"\n  ],\n\n```\nThese strings appear on Register screen and become a claim for the user.\n\nThe selected string will also become part of the connection string for the database.\n\nAdding more strings here will add more tenants.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianlparker%2Fmultitenantdbcontext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianlparker%2Fmultitenantdbcontext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianlparker%2Fmultitenantdbcontext/lists"}