public SortCondition <TEntity> ThenByDescending(string propertySelector) { if (string.IsNullOrEmpty(propertySelector)) { throw new ArgumentException("Selector string can not be null or empty", "propertySelector"); } var sortItem = new SortItem() { PropertySelector = propertySelector, SortDirection = SortDirection.Descending }; SortItems.Add(sortItem); 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", "selectorExpression"); } var sortItem = new SortItem() { PropertySelector = GetSelectorStringFromExpression(selectorExpression), SortDirection = SortDirection.Descending }; SortItems.Add(sortItem); return(this); }
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", "selectorExpression"); } var result = new SortCondition <TEntity>() { entityType = typeof(TEntity) }; var sortItem = new SortItem() { PropertySelector = GetSelectorStringFromExpression(selectorExpression), SortDirection = SortDirection.Descending }; result.SortItems.Add(sortItem); return(result); }
public static SortCondition <TEntity> OrderByDescending(string propertySelector) { if (string.IsNullOrEmpty(propertySelector)) { throw new ArgumentException("Selector string can not be null or empty", "propertySelector"); } var result = new SortCondition <TEntity>() { entityType = typeof(TEntity) }; var sortItem = new SortItem() { PropertySelector = propertySelector, SortDirection = SortDirection.Descending }; result.SortItems.Add(sortItem); return(result); }
public SortCondition <TDestionation> Cast <TDestionation>() where TDestionation : class { var sortCondition = new SortCondition <TDestionation>() { entityType = typeof(TDestionation), parameterExpression = parameterExpression, orderableParameterExpression = orderableParameterExpression }; var result = sortCondition; foreach (var sortItem in SortItems) { var sortItem1 = new SortItem() { PropertySelector = sortItem.PropertySelector, SortDirection = sortItem.SortDirection }; result.SortItems.Add(sortItem1); } return(result); }