internal NamespaceMetadata(string name, IEnumerable<Type> types)
        {
            Name = name;
            foreach (Type type in types)
            {
                if (IsChildNamespace(type.Namespace) && Namespaces.Find(ns => ns.Name.Equals(type.Namespace)) == null)
                {
                    var child = new NamespaceMetadata(type.Namespace, types);
                    if (child.AllEntities.Count > 0) Namespaces.Add(child);
                }

                if (Name.Equals(type.Namespace) && type.IsPublic && !type.IsNested && !type.IsAbstract && !type.IsEnum && !IsLocalizationType(type))
                    Entities.Add(new EntityMetadata(type));
            }
        }
Example #2
0
 internal static void Load(EntityAssembly assembly)
 {
     Root = new NamespaceMetadata(assembly.RootNamespace, assembly.GetTypes());
 }