Пример #1
0
        /// <summary>
        /// Returns a list of allowed <see cref="QuerySortEnum"/> values for this particular query.
        /// </summary>
        /// <returns>An enumeration of allowed <see cref="QuerySortEnum"/> values.</returns>
        public IEnumerable <QuerySortEnum> GetAllowedSortValues()
        {
            Type         type = GetType();
            PropertyInfo prop = type.GetProperty("Sort");
            AllowedSortValuesAttribute attribute = prop.GetCustomAttribute <AllowedSortValuesAttribute>();

            if (attribute == null)
            {
                return(Enumerable.Empty <QuerySortEnum>());
            }
            return(attribute.Values);
        }