コード例 #1
0
        public static CamlCommandData GenerateCaml(QueryModel queryModel)
        {
            var camlQueryModelVisitorBase = new CamlQueryModelVisitorBase();

            camlQueryModelVisitorBase.VisitQueryModel(queryModel);
            return(camlQueryModelVisitorBase.GetCamlCommand());
        }
コード例 #2
0
        protected override Expression VisitSubQueryExpression(SubQueryExpression expression)
        {
            var camlQueryModelVisitorBase = new CamlQueryModelVisitorBase();

            camlQueryModelVisitorBase.VisitQueryModel(expression.QueryModel);
            var parts = camlQueryModelVisitorBase._queryPartsAggregator;

            return(expression);
        }
コード例 #3
0
        public IEnumerable <T> ExecuteCollection <T>(QueryModel queryModel)
        {
            var modelName   = typeof(T).GetCustomAttribute <ContentAttribute>(true).Name;
            var commandCaml = CamlQueryModelVisitorBase.GenerateCaml(queryModel);

            if (commandCaml.QueryParts.CamlElements.FirstOrDefault(i => i.Name.Equals("ContentType")) == null)
            {
                commandCaml.QueryParts.CamlElements.Enqueue(new CamlElement()
                {
                    Logical  = CamlLogical.And,
                    Name     = "ContentType",
                    Operator = CamlOperators.Eq,
                    Type     = "Text",
                    Value    = modelName
                });
            }
            _camlString = commandCaml.Caml();
            _fields     = commandCaml.Fields();
            return(new List <T>());
        }