public SortCondition <TEntity> ThenByDescending(string propertySelector) { if (string.IsNullOrEmpty(propertySelector)) { throw new ArgumentException("Selector string can not be null or empty", nameof(propertySelector)); } var item = new SortItem { PropertySelector = propertySelector, SortDirection = SortDirection.Descending }; _sortItems.Add(item); return(this); }
public SortCondition <TEntity> ThenByDescending <TProperty>(Expression <Func <TEntity, TProperty> > selectorExpression) { if (selectorExpression == null) { throw new ArgumentException("Selector string can not be null or empty", nameof(selectorExpression)); } var item = new SortItem { PropertySelector = GetSelectorStringFromExpression(selectorExpression), SortDirection = SortDirection.Descending }; _sortItems.Add(item); return(this); }
public static SortCondition <TEntity> OrderByDescending(string propertySelector) { if (string.IsNullOrEmpty(propertySelector)) { throw new ArgumentException("Selector string can not be null or empty", nameof(propertySelector)); } var result = new SortCondition <TEntity> { _entityType = typeof(TEntity) }; var item = new SortItem { PropertySelector = propertySelector, SortDirection = SortDirection.Descending }; result._sortItems.Add(item); return(result); }
public static SortCondition <TEntity> OrderByDescending <TProperty>(Expression <Func <TEntity, TProperty> > selectorExpression) { if (selectorExpression == null) { throw new ArgumentException("Selector string can not be null or empty", nameof(selectorExpression)); } var result = new SortCondition <TEntity> { _entityType = typeof(TEntity) }; var item = new SortItem { PropertySelector = GetSelectorStringFromExpression(selectorExpression), SortDirection = SortDirection.Descending }; result._sortItems.Add(item); return(result); }
public SortCondition <TDestination> Cast <TDestination>() where TDestination : class { var result = new SortCondition <TDestination> { _entityType = typeof(TDestination), _parameterExpression = _parameterExpression, _sortableParameterExpression = _sortableParameterExpression }; foreach (var sortItem in _sortItems) { var newSortItem = new SortItem() { PropertySelector = sortItem.PropertySelector, SortDirection = sortItem.SortDirection }; result._sortItems.Add(newSortItem); } return(result); }