MVC4 Solution with WebAPI AND non-WebAPI Project

Sep 4, 2012 at 3:53 AM

I just found this solution and it's basically exactly what I needed to understand  an multiple tier structure. However, what is the purpose of creating 2 MVC projects in the solution (one WebAPI project the other not). Was this done for demonstration or does it ever make sense to actually seperate them like this in one solution.

If so, I would assume the main presentation layer is the non API project and so would it make sense to strip all the extras (Content folder, Images folder, Scripts folder, Views folder, etc) off from the WebAPI project and use it solely as an HTTP service?

Is anything gained?

May 9, 2013 at 3:21 PM
I am curious about this as well.

At first I thought the non-WebAPI would make use of the WebAPI but on inspection it appears that the WebAPI project is not required. So what's it purpose - is it just for demonstration?
Jun 10, 2013 at 2:09 PM
I'm with you guys on this one. My choice was to use ServiceStack over Web API because it's so much simpler to implement and maintain as well as the performance gains.

I may write a blog post about it, but for now just be sure to save yourself some time by following ServiceStack's instructions and apply it to the "Web" project, not a separate project like the WebAPI one. You can implement the individual classes in a separate project, thereby organizing it in a more managable way, but you need to apply the ServiceStack nuget command to the "Web" project.