Exemplo n.º 1
0
        protected override OeNavigationEntryFactory CreateEntryFactoryFromTuple(IEdmModel edmModel, OeEntryFactory parentEntryFactory)
        {
            OePropertyAccessor[] accessors = base.GetAccessorsFromTuple(edmModel);
            var navigationLinks            = new OeNavigationEntryFactory[NavigationLinks.Count];

            for (int i = 0; i < NavigationLinks.Count; i++)
            {
                navigationLinks[i] = NavigationLinks[i].CreateEntryFactoryFromTuple(edmModel, this);
            }

            ParameterExpression parameter      = Expression.Parameter(typeof(Object));
            UnaryExpression     typedParameter = Expression.Convert(parameter, edmModel.GetClrType(parentEntryFactory.EntitySet));
            MemberExpression    navigationPropertyExpression = Expression.Property(typedParameter, EdmNavigationProperty.Name);
            LambdaExpression    linkAccessor = Expression.Lambda(navigationPropertyExpression, parameter);

            return(new OeNavigationEntryFactory(
                       EntitySet,
                       accessors,
                       null,
                       navigationLinks,
                       linkAccessor,
                       EdmNavigationProperty,
                       NavigationSelectItem,
                       false));
        }
Exemplo n.º 2
0
        private OeEntryFactory CreateEntryFactoryFromTuple(IEdmModel edmModel, OePropertyAccessor[]?skipTokenAccessors)
        {
            OePropertyAccessor[] accessors = GetAccessorsFromTuple(edmModel);
            var navigationLinks            = new OeNavigationEntryFactory[NavigationLinks.Count];

            for (int i = 0; i < NavigationLinks.Count; i++)
            {
                navigationLinks[i] = NavigationLinks[i].CreateEntryFactoryFromTuple(edmModel, this);
            }

            return(new OeEntryFactory(EntitySet, accessors, skipTokenAccessors, navigationLinks));
        }