Exemple #1
0
        protected ExpandNode Compose(Expand expand, XElement parentSchema, string parentPath)
        {
            string property = expand.Property;

            XElement[] propertyPath = Schema.GenerateExpandPropertyPath(parentSchema, property);

            ExpandProperty oProperty = ExpandProperty.Create(property, propertyPath, parentSchema, Schema);

            string     path    = parentPath + "/" + property;
            ExpandNode oExpand = ExpandNode.Create(oProperty, expand.Select, expand.Filter, expand.Orderby, Schema, Parameters);

            oExpand.Path = path;

            oExpand.Children = new ExpandNode[expand.Children.Length];
            for (int i = 0; i < expand.Children.Length; i++)
            {
                oExpand.Children[i] = Compose(expand.Children[i], propertyPath[propertyPath.Length - 1], path);
            }

            return(oExpand);
        }
Exemple #2
0
        protected Expand[] GetExpands(XElement element)
        {
            List <Expand> list = new List <Expand>();

            foreach (XElement xExpand in element.Elements("expand"))
            {
                string property = xExpand.Attribute("property").Value;
                string select   = GetSelect(xExpand);
                string filter   = GetFilter(xExpand);
                string orderby  = GetOrderby(xExpand);

                Expand expand = new Expand(property, select, filter, orderby)
                {
                    Children = GetExpands(xExpand)
                };

                list.Add(expand);
            }

            return(list.ToArray());
        }