You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using ZhongLianInterface;
|
|
|
|
namespace ZhongLianService
|
|
{
|
|
public static class ZhongLianServiceExtend
|
|
{
|
|
public static IServiceCollection InitZhongLianService(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
#if !DEBUG
|
|
services.AddActors(option =>
|
|
{
|
|
option.Actors.RegisterActor<InstallActor>();
|
|
});
|
|
#endif
|
|
SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
|
|
{
|
|
DbType = SqlSugar.DbType.MySql,
|
|
ConnectionString = configuration.GetConnectionString("Default"),
|
|
IsAutoCloseConnection = true,
|
|
});
|
|
services.AddSingleton<ISqlSugarClient>(sqlSugar);
|
|
services.AddSingleton<IInstallService, InstallService>();
|
|
services.AddSingleton<IDriveService, DriveService>();
|
|
services.AddSingleton<IParamService, ParamService>();
|
|
services.AddSingleton<IMaintenanceService, MaintenanceService>();
|
|
services.AddSingleton<IProjectService, ProjectService>();
|
|
return services;
|
|
}
|
|
}
|
|
|
|
public class ZhongLianService
|
|
{
|
|
}
|
|
}
|