public async Task <Response <IOcelotConfiguration> > Get() { var repoConfig = _repo.Get(); if (repoConfig.IsError) { return(new ErrorResponse <IOcelotConfiguration>(repoConfig.Errors)); } if (repoConfig.Data == null) { var creatorConfig = await _creator.Create(); if (creatorConfig.IsError) { return(new ErrorResponse <IOcelotConfiguration>(creatorConfig.Errors)); } _repo.AddOrReplace(creatorConfig.Data); return(new OkResponse <IOcelotConfiguration>(creatorConfig.Data)); } return(new OkResponse <IOcelotConfiguration>(repoConfig.Data)); }
public Response <IOcelotConfiguration> Get() { var repoConfig = _repo.Get(); if (repoConfig.IsError) { return(new ErrorResponse <IOcelotConfiguration>(repoConfig.Errors)); } return(new OkResponse <IOcelotConfiguration>(repoConfig.Data)); }
public async Task <Response <IOcelotConfiguration> > Get() { var repoConfig = await _repo.Get(); if (repoConfig.IsError) { return(new ErrorResponse <IOcelotConfiguration>(repoConfig.Errors)); } return(new OkResponse <IOcelotConfiguration>(repoConfig.Data)); }