Ejemplo n.º 1
0
        public SortingFilter(string sortField, bool ascending)
        {
            var sortFields = SortingHelper.GetSortField();

            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;
        }
Ejemplo n.º 2
0
 public IActionResult GetSortFields()
 {
     return(Ok(SortingHelper.GetSortField().Select(x => x.Key)));
 }