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)); }
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); }