Q:

How do I extract an Action into a member function?

I have this code:
class SomeClass {
    void someFunction()
    {
          Action<string> myAction = (what)=>
          {
             //whatever
          }
          new List<string>().ForEach(myAction);
    }
}

I'd like to extract the code inside myAction into a separate member function.
How do I do that?

A:

class SomeClass
{
    void someFunction()
    {
        Action<string> myAction = Whatever;
        new List<string>().ForEach(myAction);
    }

    public void Whatever(string what)
    {
        // ... whenever
    }
}

or directly, without defining a local Action<string> variable (that will probably be optimized away in Release mode anyway):
new List<string>().ForEach(Whatever);

A:

Are you looking for this?
class SomeClass { 
    void someFunction() 
    { 
          new List<string>().ForEach(SeparateMemberFunction); 
    }
    void SeparateMemberFunction(string s)
    {
        //whatever
    } 
} 

A:

This should be equivalent:
class SomeClass {

    void myAction(string what)
    {
        // whatever
    }

    void someFunction()
    {
          new List<string>().ForEach(item => myAction(item));
    }
}

Since Action<string> means a method with a string parameter which does not return a value.

