public async Task ValidateAsync(ISecretContainer secretContainer) { if (secretContainer == null) { throw new ArgumentNullException(nameof(secretContainer)); } var secret = await this.GetBy(secretContainer); if (secretContainer.SecretId.HasValue && secret == null) { throw new InvalidOperationException($"Secret not found by id {secretContainer.SecretId}"); } }
private async Task <Secret> GetBy(ISecretContainer secretContainer) { return(await this.SecretDataAccess.GetByAsync(secretContainer)); }
public Task <Secret> GetByAsync(ISecretContainer secretId) { throw new NotImplementedException(); }