public static IEnumerable <ObjectData> GetEntityAllList(string metaObjectName, int tenantId, IFilter filter = null, string queryJson = null, Dictionary <string, SortDirection> sortFields = null, string[] columnNames = null)
        {
            //var deleteFilter = new BooleanFilter();
            //if (filter == null)
            //{
            //    filter = deleteFilter;
            //}
            //else
            //{
            //    filter = deleteFilter == null ? filter : (filter as BooleanFilter).Must(deleteFilter);
            //}
            var filterJson = filter == null ? null : ElasticSearchSerialization.Serialize(filter);

            return(GetEntityAllList(metaObjectName, tenantId, filterJson, queryJson, sortFields, columnNames));
        }
        public static IEnumerable <ObjectData> GetEntityListWithSize(string metaObjectName, int tenantId, int size, IFilter filter = null, string queryJson = null, Dictionary <string, SortDirection> sortFields = null, string[] columnNames = null)
        {
            var filterJson = filter == null ? null : ElasticSearchSerialization.Serialize(filter);

            return(GetEntityListWithSize(metaObjectName, tenantId, filterJson: filterJson, columnNames: columnNames, size: size, sortFields: sortFields));
        }
        public bool EditVerifyAppAccount(int tenantId, Guid id, string agentId, string appSecret)
        {
            var result = false;
            //添加去重条件:AgentId、AppSecret
            //思路:根据AgentId过滤多租赁,数据为空,继续根据AppSecret过滤多租赁,数据为空,则没有重复,继续之后的保存、更新操作
            var agentIdFilter = new BooleanFilter()
                                .Must(new TermFilter(AppAccount.AppAccount_AgentId, agentId));
            var appAccountList = CloudDataHelper.GetEntityAllList(AppAccount.MetaName, tenantId, agentIdFilter).ToList();
            var appAccountId   = appAccountList.Select(n => n.ID).ToList();

            if (appAccountList.Count <= 1 && appAccountId.Contains(id))
            {
                var appSecretFilter = new BooleanQuery()
                                      .Must(new MatchQuery(AppAccount.AppAccount_AppSecret, appSecret));
                var appAccount = CloudDataHelper.GetEntityAllList(AppAccount.MetaName, tenantId, queryJson: ElasticSearchSerialization.Serialize(appSecretFilter)).ToList();
                var ids        = appAccount.Select(n => n.ID).ToList();
                if (appAccount.Count <= 1 && ids.Contains(id))
                {
                    result = true;
                }
            }

            return(result);
        }