Example #1
0
File: Any.cs Project: yazici/Vipr
            public static XElement RecordCollectionAnnotation(string term, int count, IEnumerable <string> properties)
            {
                XElement element = GetAnnotationElement(term);

                XElement collectionElement = GetCollectionElement();

                for (int i = 0; i < count; i++)
                {
                    collectionElement.Add(Any.Csdl.Record(record =>
                    {
                        foreach (var property in properties)
                        {
                            record.Add(Any.Csdl.PropertyValue(property, propertyVal => propertyVal.Add(GetStringElement(Any.Word()))));
                        }
                    }));
                }

                element.Add(collectionElement);

                return(element);
            }
Example #2
0
File: Any.cs Project: yazici/Vipr
            private static XElement CallbackProtocolCollection(IEnumerable <string> ids)
            {
                XElement collectionElement = GetCollectionElement();

                foreach (var id in ids)
                {
                    collectionElement.Add(Any.Csdl.Record(record =>
                    {
                        record.Add(Any.Csdl.PropertyValue("Id", propertyVal => propertyVal.Add(GetStringElement(id))));
                        record.Add(Any.Csdl.PropertyValue("UrlTemplate", propertyVal => propertyVal.Add(GetStringElement(Any.Word()))));
                        record.Add(Any.Csdl.PropertyValue("DocumentationUrl", propertyVal => propertyVal.Add(GetStringElement(Any.Word()))));
                    }
                                                          ));
                }

                return(collectionElement);
            }
Example #3
0
File: Any.cs Project: yazici/Vipr
            public static XElement RecordAnnotation(string term, params string[] properties)
            {
                XElement element = GetAnnotationElement(term);

                element.Add(Any.Csdl.Record(record =>
                {
                    foreach (var property in properties)
                    {
                        record.Add(Any.Csdl.PropertyValue(property, propertyVal => propertyVal.Add(GetStringElement(Any.Word()))));
                    }
                }));

                return(element);
            }