/// 根据环境生成声明 /// 具体生成服务通过静态键值对注册,键为生成器名称 /// 该方法将调用对应名称的生成服务来完成 public async Task <ClaimsIdentity> Generate(EnvironmentClaimGenerator generator) { if (!_environmentClaimGeneratorServiceFactories.TryGetValue(generator.Type, out IFactory <IEnvironmentClaimGeneratorService> generatorServiceFactory)) { var fragment = new TextFragment() { Code = TextCodes.NotFoundEnvironmentClaimGeneratorServiceByType, DefaultFormatting = "找不到类型为{0}的环境声明生成服务,发生位置:{1}", ReplaceParameters = new List <object>() { generator.Type, $"{this.GetType().FullName}.EnvironmentClaimGeneratorServiceFactories" } }; throw new UtilityException((int)Errors.NotFoundEnvironmentClaimGeneratorServiceByType, fragment); } return(await generatorServiceFactory.Create().Do()); }
public async Task Update(EnvironmentClaimGenerator generator) { await _environmentClaimGeneratorStore.Update(generator); }
public async Task Delete(EnvironmentClaimGenerator generator) { await _environmentClaimGeneratorStore.Delete(generator.ID); }
public async Task Add(EnvironmentClaimGenerator generator) { await _environmentClaimGeneratorStore.Add(generator); }