diff --git a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs index 42019f7c99..fe88701266 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs @@ -1,8 +1,11 @@ using System.Collections.Concurrent; using System.Dynamic; using System.Globalization; +using System.IO; using System.Linq.Expressions; using System.Reflection; +using System.Security.Cryptography; +using Examine.Search; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Infrastructure; @@ -15,6 +18,7 @@ using Umbraco.Cms.Core.Models.Entities; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Models.TemplateQuery; +using Umbraco.Cms.Core.Persistence; using Umbraco.Cms.Core.Routing; using Umbraco.Cms.Core.Security; using Umbraco.Cms.Core.Services; @@ -745,7 +749,11 @@ public class EntityController : UmbracoAuthorizedJsonController { return new PagedResult(0, 0, 0); } - + //adding multiple conditions ,considering id,key & name as filter param + //for id as int + int.TryParse(filter, out int filterAsIntId); + //for key as Guid + Guid.TryParse(filter, out Guid filterAsGuid); // else proceed as usual entities = _entityService.GetPagedChildren( id, @@ -755,7 +763,9 @@ public class EntityController : UmbracoAuthorizedJsonController out long totalRecords, filter.IsNullOrWhiteSpace() ? null - : _sqlContext.Query().Where(x => x.Name!.Contains(filter)), + : _sqlContext.Query().Where(x => x.Name!.Contains(filter) + || x.Id == filterAsIntId + || x.Key == filterAsGuid), Ordering.By(orderBy, orderDirection));