Пример #1
0
        public virtual PagedList <Entity> QueryPaged(int page, int pageSize, Guid entityId, Guid objectId)
        {
            var query = new QueryExpression(EntityName, _appContext.GetFeature <ICurrentUser>().UserSettings.LanguageId);

            query.PageInfo = new PagingInfo()
            {
                PageNumber = page, PageSize = pageSize
            };
            query.ColumnSet.AddColumns("attachmentid", "name", "cdnpath", "description", "createdon", "createdby", "ownerid", "owningbusinessunit");
            query.Criteria.AddCondition("entityid", ConditionOperator.Equal, entityId);
            query.Criteria.AddCondition("objectid", ConditionOperator.Equal, objectId);
            query.AddOrder("createdon", OrderType.Descending);
            return(_dataFinder.RetrieveMultiple(query));
        }
Пример #2
0
        public IActionResult RetrieveMultiple(RetrieveMultipleModel args)
        {
            if (args.Query.EntityName.IsEmpty())
            {
                return(JError("entityname is not specified"));
            }
            var entity = _entityFinder.FindByName(args.Query.EntityName);

            if (entity == null)
            {
                return(JError("entityname is not found"));
            }
            if (args.IsAll)
            {
                var result = _dataFinder.RetrieveAll(args.Query);
                return(JOk(result));
            }
            else
            {
                var result = _dataFinder.RetrieveMultiple(args.Query);
                return(JOk(result));
            }
        }