ДА НЕУЖЕЛИ сработало?!

This commit is contained in:
Programmist73 2023-04-30 23:10:21 +04:00
parent 8d1b564e59
commit efd2b1aecc
2 changed files with 14 additions and 3 deletions

View File

@ -84,7 +84,7 @@ namespace BlacksmithWorkshopRestApi.Controllers
return _mailLogic.ReadList(new MessageInfoSearchModel
{
ClientId = clientId,
Page = pageSize,
Page = page,
PageSize = pageSize
});
}

View File

@ -32,8 +32,19 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
{
using var context = new BlacksmithWorkshopDatabase();
var list = context.Messages
.Select(x => x.GetViewModel);
var list = new List<MessageInfoViewModel>();
if (model.ClientId.HasValue)
{
list = context.Messages
.Where(x => x.ClientId.HasValue && x.ClientId == model.ClientId)
.Select(x => x.GetViewModel).ToList();
}
else
{
list = context.Messages
.Select(x => x.GetViewModel).ToList();
}
if (!(model.Page.HasValue && model.PageSize.HasValue))
{