Exemple #1
0
        public static FilterDefinition <MongoContentEntity> ToFilter(this FilterNode <ClrValue> filterNode, Guid schemaId)
        {
            var filters = new List <FilterDefinition <MongoContentEntity> >
            {
                Filter.Eq(x => x.IndexedSchemaId, schemaId),
                Filter.Ne(x => x.IsDeleted, true),
                filterNode.BuildFilter <MongoContentEntity>()
            };

            return(Filter.And(filters));
        }
Exemple #2
0
        private static FilterDefinition <MongoContentEntity> BuildFilter(DomainId appId, DomainId schemaId, FilterNode <ClrValue>?filterNode)
        {
            var filters = new List <FilterDefinition <MongoContentEntity> >
            {
                Filter.Eq(x => x.IndexedAppId, appId),
                Filter.Eq(x => x.IndexedSchemaId, schemaId),
                Filter.Ne(x => x.IsDeleted, true)
            };

            if (filterNode != null)
            {
                filters.Add(filterNode.BuildFilter <MongoContentEntity>());
            }

            return(Filter.And(filters));
        }
Exemple #3
0
        private static FilterDefinition <MongoContentEntity> BuildFilter(DomainId appId, DomainId schemaId, FilterNode <ClrValue>?filter)
        {
            var filters = new List <FilterDefinition <MongoContentEntity> >
            {
                Filter.Exists(x => x.LastModified),
                Filter.Exists(x => x.Id),
                Filter.Eq(x => x.IndexedAppId, appId),
                Filter.Eq(x => x.IndexedSchemaId, schemaId)
            };

            if (filter?.HasField("dl") != true)
            {
                filters.Add(Filter.Ne(x => x.IsDeleted, true));
            }

            if (filter != null)
            {
                filters.Add(filter.BuildFilter <MongoContentEntity>());
            }

            return(Filter.And(filters));
        }