Beispiel #1
0
        /// <summary>
        /// Delete an API key by its Id
        /// </summary>
        /// <param name="apiKeyId">Id of the API key to be deleted</param>
        /// <returns>True if key was deleted. Otherwise false</returns>
        public bool DeleteUserApiKey(string apiKeyId)
        {
            bool result = false;

            UserApiKey apiKey = _userApiKeyRepository.GetById(new Guid(apiKeyId));

            if (null != apiKey)
            {
                _userApiKeyRepository.Delete(apiKey);
                _userApiKeyRepository.SaveChanges();
                result = true;
            }

            return(result);
        }