BridgeStack.ComplexQuery.GetAllowedSortValues C# (CSharp) Method

GetAllowedSortValues() public method

Returns a list of allowed QuerySortEnum values for this particular query.
public GetAllowedSortValues ( ) : IEnumerable
return IEnumerable
        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;
        }