MSDN > Home page del forum > Visual C# General > How to convert a delegate Func<T> To delegate Func<String>?
Formula una domandaFormula una domanda
 

Discussione generaleHow to convert a delegate Func<T> To delegate Func<String>?

  • domenica 8 novembre 2009 9.06ablackdragon Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     

    the class is like this.
    MyClass
    {
          public delegate void Func<T>(T param); 
          public static Func method1 = null;
          public static void Fun1(String msg)
          {
                ooxx; //do something
          }
          public static void Bind( ref Func<T> m)
          {
                m = new Func<String>( Fun1);    
                //there is a error here, says Cannot implicitly convert type 'Func<string>' to 'Func<T>' 
          }
    }

    How can I bind m to method Fun, thank you.
     

Tutte le risposte