Home  /  Questions  /  Question

60   95.3
Sep 04, 2013

Where is the better place for REST interface in Pattern in Action 4.5

Hi guys,
I would like to add a rest interface using Microsoft's new WEB API in Pattern in action 4.5 solution.
The correct place where you can enter the library containing the "api controller" is the service layer ?

And the web api controller project must contain directly reference to ActionService ?

Thank you in advance!

588   99.9
Sep 21, 2014
You have probably gotten this already figured out, but I'll put my two-cents in anyway.

Short answers:
  1. In your MVC application
  2. Preferably, yes

The WebApi does not need to be in your MVC application, but it's easiest if it is.  If you aren't using MVC, and instead using WebForms, or WPF, etc., then WebApi can be in it's own project.  But either way, it should directly reference the service layer methods.

King Wilder