1

I have a project that currently is using MVC5, WebApi2 and OWIN. It has become quite a bit larger than I anticipated and I am looking into splitting it up into separate projects. I will move the business logic and data access into a new project but then I was thinking about splitting the webapi and mvc into 2 more projects.

Really, there is very little MVC. Basically just the /index.cshtml and the /Help page. Everything else is Durandal. I was thinking if I were to move that out of the main project then then I would have some flexibility with hosting. It just seems that the MVC part of the application is heavy and not needed.

I would then make a webapi project, which is really where everything is happening anyway.

I have been considering using the OWIN pipeline and wrapping the webapi as middleware and the mvc project as middleware. Then I could have multiple startup classes that could be used for different configurations. One thing that I like about this idea is the webapi and the mcv app could be used individually or together. In either case, because of the nature of OWIN, it can be self hosted or run through IIS.

Now my question is... Does this really make sense? There are potential cases for running the webapi service on its own. Are there any potential losses I will have to take in a setup like this?

Thanks.

Nick H
  • 245
  • 2
  • 13

1 Answers1

0

@mnfact :- I would refer you to create two separate solutions one with the WebApi2,OWIN and another with the MVC5. It would be the good designing. Kindly go through the link :- " MVC & Web Api projects within same Solution "

I think there are can be issues while providing authentication to the WebApi and MNV5 project separately. Same for the datacontext you have to solve the Dependency between the controllers.

Hope this help you!

Community
  • 1
  • 1
Rushee
  • 766
  • 7
  • 18