asp.net mvc - ASP Web API method access from regular MVC controllers -
I have no such complex solution, which I have applied among others using ASP Web API. I have 3 projects that are important for my solution. One is a WebAPI that has only API methods. The other two are backend and frontend for my application. I use the backend SPA approach which is loading most of the blank shells for the scene and uses AGAC to fill everything with AJAX. Because of the concerns of SEO, the decision of the front was applied in more traditional ways on the other hand, most of the goods have been presented to the server side. My question is, is it possible that web API methods should be forwarded to the front end controllers and to see the results?
There are no samples on this? I do not see a point repeating most code in regular controllers. I am searching but I can not find much.
If you have to call the web API service, the C # code (MVC controller or elsewhere), the HTTP client Or webclient can be used to call on HTTP.
If you just need to reuse the code, it should be referenced in the class library (DLL) and from the referenced Web API and MVC projects.
Comments
Post a Comment