Exemplo n.º 1
0
        public void AppendSortBy(SortItem item)
        {
            var existing = _sortBy.FirstOrDefault(sb => sb.SortBy == item.SortBy);

            if (existing != null)
            {
                _sortBy.Remove(existing);
            }

            if (item.Sequence == 1 && _sortBy.Exists(sb => sb.Sequence == 1))
            {
                item.Sequence = _sortBy.Max(sb => sb.Sequence) + 1;
            }

            _sortBy.Add(item);
        }
Exemplo n.º 2
0
 public void ClearAndAddSortBy(SortItem item)
 {
     _sortBy.Clear();
     AppendSortBy(item);
 }