Список хостов по маске. Список шаблонов по маске
This commit is contained in:
@@ -7,6 +7,7 @@ using PARR.API.Contracts.V1.Responses;
|
||||
using PARR.API.Contracts.V1.Responses.Base;
|
||||
using PARR.API.Controllers.V1.Base;
|
||||
using PARR.API.Extensions;
|
||||
using PARR.BLL.Helpers;
|
||||
using PARR.DAL.Contracts;
|
||||
using PARR.DAL.DomainModels;
|
||||
using PARR.DAL.Models;
|
||||
@@ -40,8 +41,8 @@ namespace PARR.API.Controllers.V1
|
||||
var paginationFilter = mapper.Map<PaginationFilter>(paginationQuery);
|
||||
|
||||
IQueryable<Template> query = templateService.GetWithIncludes()
|
||||
.OrderBy(t => t.Name)
|
||||
.AsSplitQuery();
|
||||
.OrderBy(t => t.Name)
|
||||
.AsSplitQuery();
|
||||
|
||||
if (filter.StatusCode.HasValue)
|
||||
{
|
||||
@@ -61,6 +62,9 @@ namespace PARR.API.Controllers.V1
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(filter.Mask))
|
||||
query = query.Where(t => EF.Functions.Like(t.Name.ToLower(), SqlHelpers.RegexToLike(filter.Mask)));
|
||||
|
||||
var templates = await templateService.GetPage(query, paginationFilter).ToListAsync();
|
||||
|
||||
if (!templates.Any())
|
||||
|
||||
Reference in New Issue
Block a user