/// <summary>
        /// The permission model cache item to add.
        /// </summary>
        /// <param name="permissionModel">The permission model cache item to add.</param>
        /// <returns>The cache item.</returns>
        public CacheItem Add(PermissionModel permissionModel)
        {
            Contract.Requires(permissionModel != null, "The permission model must not be null.");
            var cacheItem = new CacheItem(GetKey(permissionModel), permissionModel);

            cache.Set(cacheItem, GetCacheItemPolicy());
            return(cacheItem);
        }
 /// <summary>
 /// Returns a key for the cache.
 /// </summary>
 /// <param name="permission">The permission to get a key for.</param>
 /// <returns>The cache key.</returns>
 public string GetKey(PermissionModel permission)
 {
     Contract.Requires(permission != null, "The permission must not be null.");
     return(GetKey(permission.Id, permission.Name));
 }