refactor: 增加字典服务
This commit is contained in:
parent
816019e202
commit
33ed7abc0d
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ namespace BootstrapAdmin.DataAccess.Services
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class MenuService : IMenu
|
||||
class MenuService : IMenu
|
||||
{
|
||||
private IDatabase _db;
|
||||
|
||||
|
|
Loading…
Reference in New Issue