How do i assigned the type of any object to a generic method in C#

Posted by Usman on Stack Overflow See other posts from Stack Overflow or by Usman
Published on 2010-03-30T05:45:25Z Indexed on 2010/03/30 5:53 UTC
Read the original article Hit count: 278

Filed under:
|

Hi,

Suppose that I have created a method like this

private void Test<t>(t str)
{

}

Now from another method i call it

private void BtnClick()
{
    string a = "";


    test<Here I Want To assign The Type what ever the type of 'a' is>();
}

How can I do this ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about generic