ДА НЕУЖЕЛИ сработало?!
This commit is contained in:
parent
8d1b564e59
commit
efd2b1aecc
@ -84,7 +84,7 @@ namespace BlacksmithWorkshopRestApi.Controllers
|
||||
return _mailLogic.ReadList(new MessageInfoSearchModel
|
||||
{
|
||||
ClientId = clientId,
|
||||
Page = pageSize,
|
||||
Page = page,
|
||||
PageSize = pageSize
|
||||
});
|
||||
}
|
||||
|
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user