mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-20 08:26:37 +08:00
配置文件开关,数据库读写分离
This commit is contained in:
@@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Yi.Framework.Model;
|
||||
using Yi.Framework.Model.ModelFactory;
|
||||
|
||||
namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
{
|
||||
@@ -19,13 +20,10 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
//配置文件使用配置
|
||||
#endregion
|
||||
services.AddSingleton(new Appsettings(configuration));
|
||||
|
||||
#region
|
||||
//数据库配置
|
||||
#endregion
|
||||
services.AddScoped<DbContext, DataContext>();
|
||||
|
||||
|
||||
services.AddTransient<DbContext, DataContext>();
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user