This commit is contained in:
20
Api/Dilon.EntityFramework.Core/Startup.cs
Normal file
20
Api/Dilon.EntityFramework.Core/Startup.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Dilon.EntityFramework.Core
|
||||
{
|
||||
public class Startup : AppStartup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddDatabaseAccessor(options =>
|
||||
{
|
||||
options.CustomizeMultiTenants(); // 自定义租户
|
||||
|
||||
options.AddDb<DefaultDbContext>();
|
||||
options.AddDb<MultiTenantDbContext, MultiTenantDbContextLocator>();
|
||||
}, "Dilon.Database.Migrations");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user