0

I am beginner in web application development. I was told to write an end point in ASP.NET MVC 5 Project which needs to be called from a desktop app.

So, below is what I did In

Controller:

    [HttpGet]
    public ActionResult ClearCoInfo(int id)
    {
        return new EmptyResult();
    }

In WebAPI Controller

[HttpGet]
    public  IHttpActionResult  ClearCoInfo(int id)
    {
        return new EmptyResult();
    }

Now I want to know what's the difference between above two approach and which is the correct approach. Because I am able to access both via a URL. Please guide me.

Unbreakable
  • 7,776
  • 24
  • 90
  • 171
  • That does not answer my question. As I do not want a view to be returned. I just want one data (integer) to be passed from my desktop app to the web controller action. – Unbreakable Apr 18 '17 at 20:14
  • So can I use any of the above approach – Unbreakable Apr 18 '17 at 20:14
  • I want to know what's the difference in context to my scenario where if I use controller or webapi controller. Can I not call the normal controller action method from desktop app? Does it mandatorily needs to be WebApiController action? – Unbreakable Apr 18 '17 at 20:15

0 Answers0