Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I am developing a new large Web Application using ASP.NET Web API. In that, I want to separate all controller classes into one different class librarydifferent class library from ASP.NET MVC project.. Please consider following options.

Case 1 : Keeping controllers in same ASP.NET MVC project

Case 2 : Separating controllers in separate class library

  1. Is it right to go with Case#1 as I think this controller can be reusable by other projects or hosting in windows service instead of IIS Web Application.

  2. Also if in future if I want to access Web-API methods from Android,IPhone native apps then does it works for me in both cases Case#1 and Case#2

  3. Is there any performance issue with Case#2.

  4. What would be the best practice to register multiple controllers in both cases using UnityContainer.RegisterType ?

I am developing a new large Web Application using ASP.NET Web API. In that, I want to separate all controller classes into one different class library from ASP.NET MVC project.. Please consider following options.

Case 1 : Keeping controllers in same ASP.NET MVC project

Case 2 : Separating controllers in separate class library

  1. Is it right to go with Case#1 as I think this controller can be reusable by other projects or hosting in windows service instead of IIS Web Application.

  2. Also if in future if I want to access Web-API methods from Android,IPhone native apps then does it works for me in both cases Case#1 and Case#2

  3. Is there any performance issue with Case#2.

  4. What would be the best practice to register multiple controllers in both cases using UnityContainer.RegisterType ?

I am developing a new large Web Application using ASP.NET Web API. In that, I want to separate all controller classes into one different class library from ASP.NET MVC project.. Please consider following options.

Case 1 : Keeping controllers in same ASP.NET MVC project

Case 2 : Separating controllers in separate class library

  1. Is it right to go with Case#1 as I think this controller can be reusable by other projects or hosting in windows service instead of IIS Web Application.

  2. Also if in future if I want to access Web-API methods from Android,IPhone native apps then does it works for me in both cases Case#1 and Case#2

  3. Is there any performance issue with Case#2.

  4. What would be the best practice to register multiple controllers in both cases using UnityContainer.RegisterType ?

Source Link
mit
  • 1.9k
  • 5
  • 19
  • 29

ASP.Net WebAPI controller in separate Class Library

I am developing a new large Web Application using ASP.NET Web API. In that, I want to separate all controller classes into one different class library from ASP.NET MVC project.. Please consider following options.

Case 1 : Keeping controllers in same ASP.NET MVC project

Case 2 : Separating controllers in separate class library

  1. Is it right to go with Case#1 as I think this controller can be reusable by other projects or hosting in windows service instead of IIS Web Application.

  2. Also if in future if I want to access Web-API methods from Android,IPhone native apps then does it works for me in both cases Case#1 and Case#2

  3. Is there any performance issue with Case#2.

  4. What would be the best practice to register multiple controllers in both cases using UnityContainer.RegisterType ?