public ProfileResourcesBehaviour(IAuthorizationService <DataActions> authorizationService, IProvideProfilesForValidation profilesResolver) { EnsureArg.IsNotNull(authorizationService, nameof(authorizationService)); EnsureArg.IsNotNull(profilesResolver, nameof(profilesResolver)); _authorizationService = authorizationService; _profilesResolver = profilesResolver; }
public ProfileValidator(IProvideProfilesForValidation profilesResolver, IOptions <ValidateOperationConfiguration> options) { EnsureArg.IsNotNull(profilesResolver, nameof(profilesResolver)); EnsureArg.IsNotNull(options?.Value, nameof(options)); try { _resolver = new MultiResolver(new CachedResolver(ZipSource.CreateValidationSource(), options.Value.CacheDurationInSeconds), profilesResolver); } catch (Exception) { // Something went wrong during profile loading, what should we do? throw; } }