示例#1
0
 public async Task <Config> GetConfig(int environmentId, ConfigArgumentCommand request, CancellationToken cancellationToken)
 {
     return(await _objectConfigContext.Configs.SingleOrDefaultAsync(
                w => w.EnvironmentId.Equals(environmentId) && w.Code == request.ConfigCode && w.DateTo == null &&
                ((w.VersionFrom <= request.VersionFrom && request.VersionFrom < w.VersionTo) ||
                 (w.VersionFrom <= request.VersionFrom && w.VersionTo == null)), cancellationToken));
 }
示例#2
0
        public async Task <Config> GetConfig(ConfigArgumentCommand request, EnvironmentRole environmentRole, CancellationToken cancellationToken)
        {
            Data.Environment env = await _environmentService.GetEnvironment(request, environmentRole, cancellationToken);

            Config result = await GetConfig(env.EnvironmentId, request, cancellationToken);

            request.ThrowNotFoundExceptionWhenValueIsNull(result);

            return(result);
        }