Query public types in an assembly using LINQ

IEnumerable<string> publicTypes =
                from t in Assembly.GetExecutingAssembly().GetTypes()
                where t.IsPublic
                select t.FullName;
 
            foreach (string name in publicTypes)
            {
                Console.WriteLine(name);
            }

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.