0

I've been taking a look at the asp.net webapi stuff and I'm curious to know what the tipping point is for using it over using a normal mvc controller that supports rest like urls.

I've done a bit of a search and can't find any articles that specifically talk about when is the most appropriate time to use each.

1 Answer 1

3

The separation is now:

If you need to spit out dynamic views (i.e. view gets rendered on the server typically using Razor) then use ASP.NET MVC. Historically you could provide data but Web API is richer (it supports content negotiation).

If you need to provide data, then use ASP.NET Web API. You could fit in the view support but it is not meant for it.


I can see these will be joined together as ASP.NET web stack in the future versions (not the upcoming release).

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

2 Comments

@Alisotad I would go a bit further and specifically say, ASP.NET MVC makes sense if you are spitting out HTML and your client is a web browser. Javascript clients could use either.
@DarrelMiller I suppose the word of the day is then "Dynamic View", i.e. rendering the view on the Server - will update. Cheers!

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.