forked from ddrilling/AsbCloudServer
CrudServiceBase add order by id and skip/take
This commit is contained in:
parent
c2c9bad200
commit
c45b5728df
@ -43,6 +43,14 @@ namespace AsbCloudInfrastructure.Services
|
||||
if (skip >= count)
|
||||
return container;
|
||||
|
||||
query = query
|
||||
.OrderBy(e => e.Id);
|
||||
|
||||
if (skip > 0)
|
||||
query = query.Skip(skip);
|
||||
|
||||
query = query.Take(take);
|
||||
|
||||
var entities = await query
|
||||
.ToListAsync(token)
|
||||
.ConfigureAwait(false);
|
||||
@ -58,6 +66,7 @@ namespace AsbCloudInfrastructure.Services
|
||||
{
|
||||
var query = GetQueryWithIncludes();
|
||||
var entities = await query
|
||||
.OrderBy(e => e.Id)
|
||||
.ToListAsync(token).ConfigureAwait(false);
|
||||
var dto = entities.Select(entity => Convert(entity));
|
||||
return dto;
|
||||
|
Loading…
Reference in New Issue
Block a user