SHA256
feat StayExport - Stay Export Pages - Initial implementation
This commit is contained in:
@@ -4,6 +4,7 @@ using Somnia.GuestLog.Infrastructure;
|
||||
using Somnia.GuestLog.Models;
|
||||
using Somnia.GuestLog.Models.DTOs;
|
||||
using Somnia.GuestLog.Models.Entities;
|
||||
using Somnia.GuestLog.Utils;
|
||||
|
||||
namespace Somnia.GuestLog.Services.Entity;
|
||||
|
||||
@@ -69,13 +70,15 @@ public class StayExportFileEntityService(
|
||||
return dbItem is not null ? GetDtoFromDb(dbItem) : null;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<StayExportFileDTO>> GetDtoListAsync()
|
||||
public async Task<IEnumerable<StayExportFileDTO>> GetDtoListAsync(int limit = 0)
|
||||
{
|
||||
using var dbContext = contextFactory.CreateDbContext();
|
||||
|
||||
var dbList = await dbContext.StayExportFiles
|
||||
IQueryable<StayExportFile> query = dbContext.StayExportFiles
|
||||
.OrderByDescending(e => e.ExportTime)
|
||||
.ToListAsync();
|
||||
.WithLimit(limit);
|
||||
|
||||
var dbList = await query.ToListAsync();
|
||||
|
||||
return dbList.Select(e => GetDtoFromDb(e));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user