feat: 增加 IDummy 示例服务

This commit is contained in:
Argo-Lenovo 2022-06-01 18:49:53 +08:00
parent 9dfd95ce41
commit 7a95ddc039
3 changed files with 38 additions and 8 deletions

View File

@ -64,20 +64,16 @@ public static class ServiceCollectionExtensions
return db; return db;
}); });
//// 增加数据服务
//services.AddSingleton(typeof(IDataService<>), typeof(DefaultDataService<>));
// 增加多数据库支持服务 // 增加多数据库支持服务
services.AddSingleton<DBManagerService>(); services.AddSingleton<DBManagerService>();
//// 增加业务服务 // 增加业务服务
//services.AddSingleton<IApp, AppService>();
services.AddSingleton<IDict, DictService>(); services.AddSingleton<IDict, DictService>();
//services.AddSingleton<IException, ExceptionService>();
//services.AddSingleton<IGroup, GroupService>();
//services.AddSingleton<ILogin, LoginService>();
services.AddSingleton<INavigation, NavigationService>(); services.AddSingleton<INavigation, NavigationService>();
//services.AddSingleton<IRole, RoleService>();
services.AddSingleton<IUser, UserService>(); services.AddSingleton<IUser, UserService>();
// 增加示例数据服务
services.AddSingleton<IDummy, DummyService>();
return services; return services;
} }
} }

View File

@ -0,0 +1,22 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using BootstrapClient.Web.Core;
using PetaPoco;
namespace BootstrapClient.DataAccess.PetaPoco.Services;
internal class DummyService : IDummy
{
private IDatabase Database { get; }
/// <summary>
///
/// </summary>
/// <param name="db"></param>
public DummyService(DBManagerService db)
{
Database = db.Create();
}
}

View File

@ -0,0 +1,12 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
namespace BootstrapClient.Web.Core;
/// <summary>
/// 数据服务示例接口
/// </summary>
public interface IDummy
{
}