title: What is the advantage of using web API over web method in ASP.NET
body: <p>I am familiar with web method. Now I got a suggestion to use web API instead of web method. I had done a demo of ASP.NET web API it's more closer to a <em>MVC architecture</em> am using the classical asp.net web development. I don't like to mess up the <em>controller</em> (MVC concept) with classical development.</p>
  
  <p>My web Method :</p>
  
  <pre><code>[WebMethod]
  public static string GetName(int id)
  {
      return "testName";
  }
  </code></pre>
  
  <p>My Web API controller:</p>
  
  <pre><code>public class MyController : ApiController
  {
  [HttpGet]
  public string GetName(int id)
  {
      return "testName";
  }
  }
  </code></pre>
  
  <p>am really confused on this issue any one have a better idea on the same.</p>
  
  <p>What is your suggestion on the same which is the better option?</p>
  
  <p>How can i compare, if both having same piece of code?</p>