1

I want to use classic MVC controllers alongside WebAPI controllers in the same project. The classic MVC controllers will return static content, like the HTML for pages. All data will be passed around with the WebAPI.

The problem is that the controller class names end up being the same. Since WebAPI sticks API/ in the front, there's no routing conflict. I thought about creating an area and just adjusting the routing.

Any ideas?

1 Answer 1

3

Realized I can just create a new folder called ApiControllers at the top level of the project. Then all the WebAPI controllers are created under a different namespace. I didn't have to touch any routing information or anything. Simple...

Sign up to request clarification or add additional context in comments.

1 Comment

That's what I do too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.