moved sorting to base.
This commit is contained in:
parent
b348bdfe90
commit
5808884a06
@ -34,52 +34,6 @@ namespace PoweredSoft.DynamicLinq.Fluent
|
||||
return query;
|
||||
}
|
||||
|
||||
public virtual QueryBuilder<T> OrderBy(string path)
|
||||
{
|
||||
Sorts.Clear();
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Ascending,
|
||||
AppendSort = false
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual QueryBuilder<T> OrderByDescending(string path)
|
||||
{
|
||||
Sorts.Clear();
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Descending,
|
||||
AppendSort = false
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual QueryBuilder<T> ThenBy(string path)
|
||||
{
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Ascending,
|
||||
AppendSort = true
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual QueryBuilder<T> ThenByDescending(string path)
|
||||
{
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Descending,
|
||||
AppendSort = true
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
protected virtual IQueryable<T> BuildSorts(IQueryable<T> query)
|
||||
{
|
||||
Sorts.ForEach(sort =>
|
||||
|
@ -84,5 +84,51 @@ namespace PoweredSoft.DynamicLinq.Fluent
|
||||
|
||||
public QueryBuilderBase Or(Action<QueryBuilderBase> subQuery)
|
||||
=> SubQuery(subQuery, false);
|
||||
|
||||
public virtual QueryBuilderBase OrderBy(string path)
|
||||
{
|
||||
Sorts.Clear();
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Ascending,
|
||||
AppendSort = false
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual QueryBuilderBase OrderByDescending(string path)
|
||||
{
|
||||
Sorts.Clear();
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Descending,
|
||||
AppendSort = false
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual QueryBuilderBase ThenBy(string path)
|
||||
{
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Ascending,
|
||||
AppendSort = true
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual QueryBuilderBase ThenByDescending(string path)
|
||||
{
|
||||
Sorts.Add(new QueryBuilderSort
|
||||
{
|
||||
Path = path,
|
||||
SortOrder = SortOrder.Descending,
|
||||
AppendSort = true
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user