1

For example, if I get the namespaces in EntityFramework.dll using

assembly.GetTypes().Select(t => t.Namespace).Where(n => n != null).Distinct() 

and then only list the namespaces with the minimum periods, I get the following two namespaces

System.Data.Entity
System.Linq.Expressions

However, System.Linq.Expressions is the namespace of an assembly that EntityFramework.dll is dependent on and not the primary namespace of EntityFramework.dll, which clearly is System.Data.Entity.

How do I distinguish between the 2?

EDIT: By "primary namespace", I am referring to the root namespace of the classes within the assembly itself and not its dependencies.

goluhaque
  • 561
  • 5
  • 17
  • 2
    IMO I think there is no such thing as "primary namespace". – hardkoded Aug 27 '18 at 14:59
  • By "primary namespace", I am referring to the root namespace of the classes within the assembly itself and not its dependencies. I apologize if it is confusing. I will edit the question. – goluhaque Aug 27 '18 at 15:02
  • 1
    Yeah, What I mean is that's a convention, not something that exists as a concept. – hardkoded Aug 27 '18 at 15:04

0 Answers0