MVC Web Api
Can we call MVC action method from MVC Web Api 2.0?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 16, 2015, 12:11 AM EDT
That's sounds not the right thing to do. If you need to simply reuse code, it should be abstracted into a class library (DLL) and referenced from the Web API and MVC projects.
If you need to call Web API service from C# code (MVC controllers or elsewhere), HttpClient or WebClient can be used to call the services over HTTP.