Example #1
0
        public void Apply(NavigationSourceConfiguration configuration, ODataModelBuilder model)
        {
            IList <Tuple <StructuralTypeConfiguration, IList <MemberInfo>, NavigationPropertyConfiguration> > navigations =
                new List <Tuple <StructuralTypeConfiguration, IList <MemberInfo>, NavigationPropertyConfiguration> >();
            Stack <MemberInfo> path = new Stack <MemberInfo>();

            model.FindAllNavigationProperties(configuration.EntityType, navigations, path);
            foreach (var navigation in navigations)
            {
                NavigationSourceConfiguration targetNavigationSource = GetTargetNavigationSource(
                    navigation.Item3, model);
                if (targetNavigationSource != null)
                {
                    configuration.AddBinding(navigation.Item3, targetNavigationSource, navigation.Item2);
                }
            }
        }