How can I use my Web Api project from other projects inside my solution?
asp.net, asp.net-web-api, c#
Solution
Access to Web API controllers and actions are based on urls. So now that they are on separate projects you need to run both projects at the same time to make your API available for MVC project.
and by the way you should enable CORS for your web api project so that you can access it from your MVC project.
Problem
I am developing a ASP.NET Web Api and a ASP.NET Website. The website will make use of the Web Api and a mobile app will also be using the Web Api via REST. Developing these two separately is going fine, however I am now at the stage where I would like to start testing the Web Api from the Website, ideally all from within visual studio. For instance, I have a page where I have a form, that when completed would call my Web Api to add a user to the database.Uploading these online for testing is naturally out of the question. So what is the best practice here? Can you simply reference the Web Api from within the Website project (Aspx) or is there another way to go about this.