title: Calling custom function in asp.net MVC web api
body: <p>I have an authenticate function in my company controller</p>
  
  <pre><code>    [ActionName("Authenticate")]
      [HttpGet]
      public bool Authenticate(Company company)
      {
          if (Uow.Companies.AuthenticateCompany(company))            
              return true;                
          return false;
      }
  </code></pre>
  
  <p>that is called using the following ajax query</p>
  
  <pre><code>$.ajax({ url: "/api/company/Authenticate", type: 'get', data: company })
  </code></pre>
  
  <p>company is a js object</p>
  
  <pre><code>Company: function (name, phoneNumber, password) {
      this.Name = name;
      this.PhoneNumber = phoneNumber;
      this.password = password;
  }
  
  var company = new Company($('#TextBoxCompanyName').val(),'00000000', $('#TextBoxCompanyPassword').val());
  </code></pre>
  
  <p>and my api route is as follows</p>
  
  <pre><code>    config.Routes.MapHttpRoute(
          name: "Action",
          routeTemplate: "api/{controller}/{action}"
      );
  </code></pre>
  
  <p>When the code runs the web api calls the following function in the company controller</p>
  
  <pre><code> public Company Get(int id)
      {
          return Uow.Companies.GetById(id);
      }
  </code></pre>
  
  <p>How do I call a custom get function?</p>