title: dynamic vs object keyword on method params and return type
body: <p>A very basic question, consider this methods:</p>
  
  <pre><code>public object Foo(object bar) {... }
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>public dynamic Bar(dynamic bar) {... }
  </code></pre>
  
  <p>While practically I don't have method signature like this, this example simplified for brevity to show two things: 'dynamic vs object' keyword in method parameter and return's.</p>
  
  <p><strong>What is the difference between these two methods, does it generate the same IL or any performance impact?</strong></p>
  
  <p><em>Based on reference/workthrough/example out there that tell dynamic is just like object with added dynamic feature, I guess both are the same thing but only differ based on usage like if I want to add another dynamic properties/methods on the return value. However I still wonder if there is another key things to consider.</em></p>
  
  <p>Note that if I have a class that has a <code>Bar</code> method like above and implement an interface with a method signature like below (or vice versa), the compiler does not complain anything.</p>
  
  <pre><code>object Bar(object bar);
  </code></pre>
  
  <p>After about 3 years of the existence, I just has a chance to use dynamic feature in a project like creating dynamic repository to be consumed by Web API and generate (dynamic) JSON.</p>
  
  <pre><code>public interface IRepository
  {
      IEnumerable GetAll(string entityName, int skip, int take);
      int Count(string entityName);
      dynamic GetById(string entityName, int key);
      void Add(string entityName, dynamic entity);
      void Remove(string entityName, int key);
  }
  </code></pre>
  
  <p>Where an entity is not concrete and <code>entityName</code> is defined in a db column. I also considering either to use <code>IEnumerable</code> or <code>IEnumerable&lt;dynamic&gt;</code>. Any thought?</p>