title: Cannot convert from 'method group' to Action
body: <p>Will be more easy to post the code first then ask why I'm getting this error.</p>
  
  <h3>Abstract class - Packet</h3>
  
  <pre><code>abstract class Packet
  {
      // base class!
  }
  </code></pre>
  
  <h3>My first packet</h3>
  
  <pre><code>public sealed class FirstPacket : Packet
  {
      // First packet implementations...
  }
  </code></pre>
  
  <h3>Another Packet</h3>
  
  <pre><code>public sealed class AnotherPacket : Packet
  {
      // Another packet implementations...
  }
  </code></pre>
  
  <h3>Packet OpCodes</h3>
  
  <pre><code>public enum OpCode
  {
      FirstPacket,
      AnotherPacket
  }
  </code></pre>
  
  <h3>Abstract class - BaseConnection</h3>
  
  <pre><code>public abstract class BaseConnection
  {
      private Dictionary&lt;OpCode, Action&lt;Packet&gt;&gt; _packetHandlers;
  
      public Connection() {
          _packetHandlers = new Dictionary&lt;OpCode, Action&lt;Packet&gt;&gt;();
      }
  }
  </code></pre>
  
  <h3>Finally, my Client</h3>
  
  <pre><code>public sealed class Client : BaseConnection
  {
      public Client() : base() {
          // Here will throw the errors...
          // CS1503   Argument 2: cannot convert from 'method group' to 'Action&lt;Packet&gt;'
          _packetHandlers.Add(OpCode.FirstPacket, OnReceiveFirst);
          _packetHandlers.Add(OpCode.AnotherPacket, OnReceiveAnother);
      }
  
      public void OnReceiveFirst(FirstPacket packet) {
      }
  
      public void OnReceiveAnother(AnotherPacket packet) {
      }
  }
  </code></pre>
  
  <p>According to <a href="https://stackoverflow.com/a/4595072/2208678">this</a> answer, a derived class is an instance of its base class and no casting involved.</p>
  
  <p>In my code, if both <code>FirstPacket</code> and <code>AnotherPacket</code> <strong>is</strong> <code>Packet</code>, why I have to "cast" using lambda?</p>
  
  <pre><code>public sealed class Client : BaseConnection
  {
      public Client() : base() {
          // This works...
          _packetHandlers.Add(OpCode.FirstPacket, p =&gt; { OnReceiveFirst((FirstPacket)p); });
          _packetHandlers.Add(OpCode.AnotherPacket, p =&gt; { OnReceiveAnother((AnotherPacket)p); });
      }
  
      public void OnReceiveFirst(FirstPacket packet) {
      }
  
      public void OnReceiveAnother(AnotherPacket packet) {
      }
  }
  </code></pre>
  
  <p>It doesn't make sense to me.</p>