using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;namespace WindowsApplication275
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();            MethodInfo get = null;            foreach (MethodInfo MI in this.GetType().GetMethods())
                if (MI.Name == "Get" && MI.IsGenericMethod)
                    get = MI;            get = get.MakeGenericMethod(new Type[] { typeof(TItem) }); 
            get.Invoke(this,new Object[]{"XXX"});
        }        public class TTypeToGet
        {
        }        public class TItem : TTypeToGet
        {
        }        public TTypeToGet Get<TTypeToGet>(string id) where TTypeToGet : TItem
        {
            return (TTypeToGet)Get(id);
        }        public TItem Get(string id)
        {
            MessageBox.Show(id);            return new TItem();
        } 
    }
}