Esempio n. 1
0
        public SortingFilter(string sortField, bool ascending)
        {
            var sortFields = SortingHelper.GetSortFields();

            sortField = sortField.ToLower();

            if (sortFields.Select(x => x.Key).Contains(sortField.ToLower()))
            {
                sortField = sortFields.Where(x => x.Key == sortField).Select(x => x.Value).SingleOrDefault();
            }
            else
            {
                sortField = "Id";
            }

            SortField = sortField;
            Ascending = ascending;
        }
Esempio n. 2
0
 public IActionResult GetSortFields()
 {
     return(Ok(SortingHelper.GetSortFields().Select(x => x.Key)));
 }