Exemplo n.º 1
0
 /// <summary>
 /// 注入缓存仓储层
 /// </summary>
 /// <param name="builder"></param>
 private static void AddRepositoriesCache(this ASFBuilder builder)
 {
     builder.Services.AddScoped <IUnitOfWork, UnitOfWork>();
     builder.Services.AddScoped <ILoggingRepository, LogInfoRepository>();
     builder.AddAccountRepositoryCache <AccountRepository>();
     builder.AddPermissionRepositoryCache <PermissionRepository>();
     builder.AddRoleRepositoryCache <RoleRepository>();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 注入缓存仓储层
 /// </summary>
 /// <param name="builder"></param>
 private static void AddRepositoriesCache(this ASFBuilder builder, ASFOptions options)
 {
     builder.Services.AddDbContext <RepositoryContext>(opt => opt.UseSqlite(options.DbConnectionString), ServiceLifetime.Scoped);
     builder.Services.AddScoped <IUnitOfWork, UnitOfWork>();
     builder.Services.AddScoped <ILoggingRepository, LogInfoRepository>();
     builder.AddAccountRepositoryCache <AccountRepository>();
     builder.AddPermissionRepositoryCache <PermissionRepository>();
     builder.AddRoleRepositoryCache <RoleRepository>();
 }