refactor: 增加字典服务

This commit is contained in:
Argo-Tianyi 2021-12-11 09:30:04 +08:00
parent 816019e202
commit 33ed7abc0d
4 changed files with 31 additions and 2 deletions

View File

@ -18,7 +18,6 @@ namespace Microsoft.Extensions.DependencyInjection
/// <returns></returns>
public static IServiceCollection AddDataAccessServices(this IServiceCollection services)
{
services.TryAddSingleton<IMenu, MenuService>();
services.TryAddSingleton<IDatabase>(provider =>
{
//TODO: 后期改造成自定适配
@ -26,6 +25,9 @@ namespace Microsoft.Extensions.DependencyInjection
var connString = configuration.GetConnectionString("bb");
return new Database<SQLiteDatabaseProvider>(connString);
});
services.TryAddSingleton<IMenu, MenuService>();
services.TryAddSingleton<IDict, DictService>();
return services;
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BootstrapAdmin.DataAccess.Services
{
class DictService : IDict
{
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BootstrapAdmin.DataAccess.Services
{
/// <summary>
/// Dict 字典表接口
/// </summary>
public interface IDict
{
}
}

View File

@ -6,7 +6,7 @@ namespace BootstrapAdmin.DataAccess.Services
/// <summary>
///
/// </summary>
public class MenuService : IMenu
class MenuService : IMenu
{
private IDatabase _db;