Exemplo n.º 1
0
        public static IQueryBuilder CreateFilesQueryBuilder(IServerApiService repository)
        {
            var userTypes = repository
                            .GetTypes()
                            .Where(x => x.Value.Kind == TypeKind.User)
                            .Select(x => x.Key)
                            .ToArray();

            var builder = new QueryBuilderImpl();

            builder.Must(ObjectFields.TypeId.BeAnyOf(userTypes));
            return(builder);
        }
Exemplo n.º 2
0
        public static IQueryBuilder CreateObjectQueryBuilder(IServerApiService repository, ObjectState[] objectStates)
        {
            var userTypes = repository
                            .GetTypes()
                            .Where(x => x.Value.Kind == TypeKind.User &&
                                   !x.Value.IsTaskType() &&
                                   !x.Value.IsWorkflowStageType() &&
                                   !x.Value.IsWorkflowType())
                            .Select(x => x.Value.Id)
                            .ToArray();

            var builder = new QueryBuilderImpl();

            builder.Must(ObjectFields.ObjectState.BeAnyOf(objectStates.ToArray()));
            builder.Must(ObjectFields.TypeId.BeAnyOf(userTypes));
            return(builder);
        }