24 lines
803 B
C#
24 lines
803 B
C#
using Dapper;
|
|
using Furion;
|
|
using Furion.DatabaseAccessor;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Ewide.EntityFramework.Core
|
|
{
|
|
public class Startup : AppStartup
|
|
{
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddDatabaseAccessor(options =>
|
|
{
|
|
options.CustomizeMultiTenants(); // 自定义租户
|
|
|
|
options.AddDb<DefaultDbContext>();
|
|
options.AddDb<MultiTenantDbContext, MultiTenantDbContextLocator>();
|
|
}, "Ewide.Database.Migrations");
|
|
|
|
// 注册dapper, 目前只能强行写死连接字符串和数据库程序集
|
|
services.AddDapper(App.Configuration["ConnectionStrings:DefaultConnection"], SqlProvider.MySql);
|
|
}
|
|
}
|
|
} |