public virtual async Task <int> DeleteApiResourceSecretAsync(ApiResourceSecretsDto apiSecret)
        {
            var secret = apiSecret.ToEntity();

            var deleted = await ApiResourceRepository.DeleteApiResourceSecretAsync(secret);

            await AuditEventLogger.LogEventAsync(new ApiSecretDeletedEvent(apiSecret.ApiResourceId, apiSecret.ApiSecretId));

            return(deleted);
        }
        public virtual async Task <int> AddApiResourceSecretAsync(ApiResourceSecretsDto apiSecret)
        {
            HashApiSharedSecret(apiSecret);

            var secret = apiSecret.ToEntity();

            var added = await ApiResourceRepository.AddApiResourceSecretAsync(apiSecret.ApiResourceId, secret);

            await AuditEventLogger.LogEventAsync(new ApiSecretAddedEvent(apiSecret.ApiResourceId, apiSecret.Type, apiSecret.Expiration));

            return(added);
        }