internal static ExpandNode Create(ExpandProperty property, string select, string filter, string orderby, XElement schema, ParameterCollection parameterCollection) { if (property is EntityProperty) { EntityProperty entityProperty = property as EntityProperty; return(new EntityExpandNode(property.Relationship, property.Name, entityProperty.Entity, select, filter, orderby, schema, parameterCollection)); } else if (property is CollectionProperty) { CollectionProperty collectionProperty = property as CollectionProperty; return(new CollectionExpandNode(property.Relationship, property.Name, collectionProperty.Collection, select, filter, orderby, schema, parameterCollection)); } throw new NotSupportedException(property.GetType().ToString()); // never }