1 refactor(config): 将AppSettings移至Application层并更新配置结构
2
3 - 将AppSettings从DMS.Infrastructure移至DMS.Application
4 - 将DatabaseSettings重命名为AppSettings.Database并更新所有引用
5 - 将配置文件从appSettings.json更改为dms_config.json
6 - 更新所有项目引用以使用新的AppSettings命名空间
7 - 移除DI容器中的SqlSugarDbContext直接实例化
8 - 添加Material Design Icons字体并更新设置视图UI
9 - 通过移除不必要的变量映射更新来优化S7服务
10 - 将数据库连接字符串属性名从Database更新为DbName
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Windows;
|
||||
using AutoMapper;
|
||||
using AutoMapper.Internal;
|
||||
using DMS.Application.Configurations;
|
||||
using DMS.Application.Interfaces;
|
||||
using DMS.Application.Interfaces.Database;
|
||||
using DMS.Application.Interfaces.Management;
|
||||
@@ -15,7 +16,6 @@ using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Interfaces.Repositories.Triggers;
|
||||
using DMS.Core.Interfaces.Services;
|
||||
using DMS.Infrastructure.Configuration;
|
||||
using DMS.Infrastructure.Configurations;
|
||||
using DMS.Infrastructure.Data;
|
||||
using DMS.Infrastructure.Interfaces;
|
||||
using DMS.Infrastructure.Interfaces.Services;
|
||||
@@ -174,6 +174,7 @@ public partial class App : System.Windows.Application
|
||||
services.AddSingleton<ILoggerFactory, NLogLoggerFactory>();
|
||||
services.AddSingleton<GrowlNotificationService>();
|
||||
services.AddSingleton<INotificationService, NotificationService>();
|
||||
|
||||
|
||||
// 注册核心服务
|
||||
services.AddAutoMapper(cfg =>
|
||||
@@ -218,11 +219,7 @@ public partial class App : System.Windows.Application
|
||||
|
||||
// 注册Core中的仓库
|
||||
services.AddSingleton<AppSettings>();
|
||||
services.AddSingleton<SqlSugarDbContext>(_ =>
|
||||
{
|
||||
var appSettings = new AppSettings { Database = { Database = "dms_test" } };
|
||||
return new SqlSugarDbContext(appSettings);
|
||||
});
|
||||
services.AddSingleton<SqlSugarDbContext>();
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user