Esempio n. 1
0
        protected static void AddChildInstanceAnnotations(ODataItem item, IList <object> childEntries)
        {
            var annotation = item.GetAnnotation <ChildInstanceAnnotation>();

            if (annotation == null)
            {
                annotation = new ChildInstanceAnnotation {
                    ChildInstances = childEntries
                };
                item.SetAnnotation(annotation);
            }
        }
Esempio n. 2
0
        private void AddChildInstanceAnnotation(ODataItem item, object childEntry)
        {
            var annotation = item.GetAnnotation <ChildInstanceAnnotation>();

            if (annotation == null)
            {
                annotation = new ChildInstanceAnnotation {
                    ChildInstances = new List <object>()
                };
                item.SetAnnotation(annotation);
            }

            annotation.ChildInstances.Add(childEntry);
        }
Esempio n. 3
0
        private void AddBoundNavigationPropertyAnnotation(ODataItem item, ODataNestedResourceInfo navigationLink, object boundValue)
        {
            var annotation = item.GetAnnotation <BoundNavigationPropertyAnnotation>();

            if (annotation == null)
            {
                annotation = new BoundNavigationPropertyAnnotation {
                    BoundProperties = new List <Tuple <ODataNestedResourceInfo, object> >()
                };
                item.SetAnnotation(annotation);
            }

            annotation.BoundProperties.Add(new Tuple <ODataNestedResourceInfo, object>(navigationLink, boundValue));
        }
Esempio n. 4
0
        private void AddChildInstanceAnnotation(ODataItem item, object childEntry)
        {
            var annotation = item.GetAnnotation<ChildInstanceAnnotation>();
            if (annotation == null)
            { 
                annotation = new ChildInstanceAnnotation { ChildInstances = new List<object>() };
                item.SetAnnotation(annotation);
            }

            annotation.ChildInstances.Add(childEntry);
        }
Esempio n. 5
0
        private void AddBoundNavigationPropertyAnnotation(ODataItem item, ODataNavigationLink navigationLink, object boundValue)
        {
            var annotation = item.GetAnnotation<BoundNavigationPropertyAnnotation>();
            if (annotation == null)
            { 
                annotation = new BoundNavigationPropertyAnnotation { BoundProperties = new List<Tuple<ODataNavigationLink, object>>() };
                item.SetAnnotation(annotation);
            }

            annotation.BoundProperties.Add(new Tuple<ODataNavigationLink, object>(navigationLink, boundValue));
        }