コード例 #1
0
        /// <summary>
        /// Safely get the given property for the model as an array of string.
        /// </summary>
        /// <param name="model">The model to search</param>
        /// <param name="propertyKey">The given key of the property</param>
        /// <returns>The value of the property in the given model, or an empty array if the property is not set</returns>
        public static string[] GetPropertyAsArray(this IExtensibleModel model, string propertyKey)
        {
            string[] result = new string[0];
            if (model.IsPropertySet(propertyKey))
            {
                result = model.ExtendedProperties.GetPropertyAsArray(propertyKey);
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Safely get the given property for the model
        /// </summary>
        /// <param name="model">The model to search</param>
        /// <param name="propertyKey">The given key of the property</param>
        /// <returns>The value of the property in the given model, or null if the property is not set</returns>
        public static string GetProperty(this IExtensibleModel model, string propertyKey)
        {
            string result = null;

            if (model.IsPropertySet(propertyKey))
            {
                result = model.ExtendedProperties.GetProperty(propertyKey);
            }

            return(result);
        }