/// <summary>
        /// Obtain <see cref="ActionExecutionModelMetadata"/>
        /// for an instance derived from <see cref="ActionExecutionModel"/>.
        /// </summary>
        /// <param name="metadataProvider">The metadata provider to </param>
        /// <param name="metadataDetailsProvider"></param>
        /// <param name="actionExecutionModel"></param>
        /// <returns>Returns the model metadata.</returns>
        public static ActionExecutionModelMetadata GetMetadata(
            IModelMetadataProvider metadataProvider,
            ICompositeMetadataDetailsProvider metadataDetailsProvider,
            ActionExecutionModel actionExecutionModel)
        {
            if (metadataProvider == null)
            {
                throw new ArgumentNullException(nameof(metadataProvider));
            }
            if (metadataDetailsProvider == null)
            {
                throw new ArgumentNullException(nameof(metadataDetailsProvider));
            }
            if (actionExecutionModel == null)
            {
                throw new ArgumentNullException(nameof(actionExecutionModel));
            }

            var key = new ActionExecutionModelMetadataKey(actionExecutionModel, metadataProvider, metadataDetailsProvider);

            return(metadataCache.Get(key));
        }
 private static ActionExecutionModelMetadata CreateMetadata(ActionExecutionModelMetadataKey metadataKey)
 => new ActionExecutionModelMetadata(metadataKey.MetadataProvider, metadataKey.MetadataDetailsProvider, metadataKey.Model);