Linq and Reflection

This snippet will show how LINQ can be used with reflection to retrieve specific metadata about type that match a specified search criterion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Linq_Tips
    class Program
        static void Main(string[] args)
            Assembly assembly = Assembly.Load("System.Data, Version=, Culture=neutral, " + "PublicKeyToken= b77a5c561934e089");
            var Query = from type in assembly.GetTypes()
                        where type.IsClass
                        select type;
            foreach (var item in Query)

            Console.WriteLine("Press any key to exit ... ");


No comments:

Post a Comment