Ejemplo n.º 1
0
        public static List <NavigationProperty> GetListProperties(this Edmx edmx, Type entityClrType)
        {
            List <NavigationProperty> properties = new List <NavigationProperty>();

            string entityName = entityClrType.Name;

            foreach (NavigationProperty navigationProperty in edmx.GetNavigationProperties(entityName))
            {
                PropertyInfo propertyInfo = entityClrType.GetProperty(navigationProperty.Name);
                if (EFLibrary.Reflection.IsCollection(propertyInfo))
                {
                    properties.Add(navigationProperty);
                }
            }

            return(properties);
        }
Ejemplo n.º 2
0
 public static NavigationProperty GetNavigationProperty(this Edmx edmx, string entityName, string navigationPropertyName)
 {
     return(edmx.GetNavigationProperties(entityName).Where(n => n.Name == navigationPropertyName).Single());
 }