Пример #1
0
        private static FilterDefinition <MongoContentEntity> BuildFilter(DomainId appId, DomainId schemaId, FilterNode <ClrValue>?filter)
        {
            var filters = new List <FilterDefinition <MongoContentEntity> >
            {
                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));
        }