Browse Source

默认时间倒序

master
boxu.zheng 1 year ago
parent
commit
b00d562c34
  1. BIN
      Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/ProjectEvaluation/winformsapp1.metadata.v7.bin
  2. BIN
      Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/ProjectEvaluation/winformsapp1.projects.v7.bin
  3. BIN
      Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/WinFormsApp1/v17/.futdcache.v2
  4. BIN
      Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/WinFormsApp1/v17/.suo
  5. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs

BIN
Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/ProjectEvaluation/winformsapp1.metadata.v7.bin

Binary file not shown.

BIN
Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/ProjectEvaluation/winformsapp1.projects.v7.bin

Binary file not shown.

BIN
Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/WinFormsApp1/v17/.futdcache.v2

Binary file not shown.

BIN
Code/Be/CreateEntityByDBTable/WinFormsApp1/.vs/WinFormsApp1/v17/.suo

Binary file not shown.

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs

@ -533,9 +533,17 @@ public class ZbxBase<TEntity, TEntityDto, TKey, TPagedAndSortedResultRequestDto,
private IQueryable<TEntity> GetSortingQueryable(IQueryable<TEntity> entities, string sorting) private IQueryable<TEntity> GetSortingQueryable(IQueryable<TEntity> entities, string sorting)
{ {
if (string.IsNullOrEmpty(sorting)) if (string.IsNullOrEmpty(sorting))
{
var createTimePropertyInfo = typeof(TEntity).GetProperty("CreationTime");
if (createTimePropertyInfo != null)
{
entities = entities.OrderBy("CreationTime DESC");
}
else
{ {
entities = entities.OrderBy("Id"); entities = entities.OrderBy("Id");
} }
}
else else
{ {
var sortParams = sorting?.Split(' '); var sortParams = sorting?.Split(' ');

Loading…
Cancel
Save