Beispiel #1
0
 /// <summary>
 /// 添加事件组件。
 /// </summary>
 /// <param name="builder">服务构建实例。</param>
 /// <returns>返回服务构建实例。</returns>
 public static IServiceBuilder AddEvent(this IServiceBuilder builder)
 {
     builder.AddTransients <IDataMigration, DefaultEventDataMigration>();
     builder.AddSingleton <IEventManager, EventManager>();
     builder.AddSingleton <IEventLogger, EventLogger>();
     return(builder);
 }
Beispiel #2
0
 /// <summary>
 /// 添加数据库基础组件。
 /// </summary>
 /// <param name="builder">服务构建实例。</param>
 /// <returns>返回服务构建实例。</returns>
 public static IServiceBuilder AddDataInitializer(this IServiceBuilder builder)
 {
     builder.AddSingleton <IInitializerManager, InitializerManager>();
     return(builder);
 }
Beispiel #3
0
 /// <summary>
 /// 添加对象更改实例组件。
 /// </summary>
 /// <param name="builder">服务构建实例。</param>
 /// <returns>返回服务构建实例。</returns>
 public static IServiceBuilder AddDiffer(this IServiceBuilder builder)
 {
     builder.AddTransients <IDataMigration, DefaultDifferDataMigration>();
     builder.AddSingleton <IDifferManager, DifferManager>();
     return(builder);
 }
Beispiel #4
0
 /// <summary>
 /// 添加服务。
 /// </summary>
 /// <param name="builder">服务构建实例。</param>
 public void ConfigureServices(IServiceBuilder builder)
 {
     builder.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
     builder.AddScoped(services => services.GetRequiredService <IUserManager>().GetUser() ?? new User {
     });
 }