public static CamlCommandData GenerateCaml(QueryModel queryModel) { var camlQueryModelVisitorBase = new CamlQueryModelVisitorBase(); camlQueryModelVisitorBase.VisitQueryModel(queryModel); return(camlQueryModelVisitorBase.GetCamlCommand()); }
protected override Expression VisitSubQueryExpression(SubQueryExpression expression) { var camlQueryModelVisitorBase = new CamlQueryModelVisitorBase(); camlQueryModelVisitorBase.VisitQueryModel(expression.QueryModel); var parts = camlQueryModelVisitorBase._queryPartsAggregator; return(expression); }
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>()); }