File tree 4 files changed +11
-20
lines changed
LinkDotNet.Blog.Infrastructure/Persistence
LinkDotNet.Blog.Web/Shared
4 files changed +11
-20
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,12 @@ public Task<IPagedList<TEntity>> GetAllAsync(
34
34
35
35
if ( orderBy != null )
36
36
{
37
- if ( descending )
38
- {
39
- return Task . FromResult ( result . OrderByDescending ( orderBy . Compile ( ) ) . ToPagedList ( page , pageSize ) ) ;
40
- }
41
-
42
- return Task . FromResult ( result . OrderBy ( orderBy . Compile ( ) ) . ToPagedList ( page , pageSize ) ) ;
37
+ result = descending
38
+ ? result . OrderByDescending ( orderBy . Compile ( ) )
39
+ : result . OrderBy ( orderBy . Compile ( ) ) ;
43
40
}
44
41
45
- return Task . FromResult ( entities . ToPagedList ( page , pageSize ) ) ;
42
+ return Task . FromResult ( result . ToPagedList ( page , pageSize ) ) ;
46
43
}
47
44
48
45
public Task StoreAsync ( TEntity entity )
Original file line number Diff line number Diff line change @@ -41,12 +41,9 @@ public async Task<IPagedList<TEntity>> GetAllAsync(
41
41
42
42
if ( orderBy != null )
43
43
{
44
- if ( descending )
45
- {
46
- return await query . OrderByDescending ( orderBy ) . ToPagedListAsync ( page , pageSize ) ;
47
- }
48
-
49
- return await query . OrderBy ( orderBy ) . ToPagedListAsync ( page , pageSize ) ;
44
+ query = descending
45
+ ? query . OrderByDescending ( orderBy )
46
+ : query . OrderBy ( orderBy ) ;
50
47
}
51
48
52
49
return await query . ToPagedListAsync ( page , pageSize ) ;
Original file line number Diff line number Diff line change @@ -39,12 +39,9 @@ public async Task<IPagedList<TEntity>> GetAllAsync(
39
39
40
40
if ( orderBy != null )
41
41
{
42
- if ( descending )
43
- {
44
- return await entity . OrderByDescending ( orderBy ) . ToPagedListAsync ( page , pageSize ) ;
45
- }
46
-
47
- return await entity . OrderBy ( orderBy ) . ToPagedListAsync ( page , pageSize ) ;
42
+ entity = descending
43
+ ? entity . OrderByDescending ( orderBy )
44
+ : entity . OrderBy ( orderBy ) ;
48
45
}
49
46
50
47
return await entity . ToPagedListAsync ( page , pageSize ) ;
Original file line number Diff line number Diff line change 16
16
<li ><h6 class =" dropdown-header" >Others</h6 ></li >
17
17
<li ><a class =" dropdown-item" href =" Sitemap" >Sitemap</a ></li >
18
18
<li ><hr class =" dropdown-divider" ></li >
19
- <li ><a class =" dropdown-item" href =" https://github.com/linkdotnet/Blog/releases" >Version 2.5 </a ></li >
19
+ <li ><a class =" dropdown-item" href =" https://github.com/linkdotnet/Blog/releases" >Version 2.6 </a ></li >
20
20
</ul >
21
21
</li >
22
22
<li class =" nav-item" ><a class =" nav-link" href =" logout" >Log out</a ></li >
You can’t perform that action at this time.
0 commit comments