0

I`ve already asked for something here Update view in response to web service requests AND I got the answer for most important question however I have another one related to this.

I have 2 projects in my solution (actually more but others are irrelevant in this case) - ServiceStack web services which is library type of project and MVC application. I would like to use mvc app's functions or variables (so share MVC project's memory with web service). I can do this if I move web services classes into the main project but I would like to keep it separated. I, of course, already added web service's project reference into main project (MVC) but I can't add main project references info web services project because it says that it cannot be done because it would result in circular dependencies, which isn't anything strange.

What's the best solution to either share memory between these projects or provide a communication channel between them. I don't want to, for example, make requests to my controller's public methods. I know that when you face circular dependencies it means you did something wrong while designing a solution but in this case these 2 projects are separated only to separate web services classes from the main project.

Community
  • 1
  • 1
Rafal
  • 23
  • 1
  • 4

2 Answers2

0

You should add a third project that includes all the common classes you need to use from both your projects.

gbellmann
  • 1,945
  • 1
  • 22
  • 27
0

Look at the MVC Integration and ServiceStack Integration wiki pages for docs on integrating between ServiceStack and MVC. e.g. if your MVC Controller inherits ServiceStackController you'll have access to ServiceStack dependencies and IOC to resolve any registered dependencies. You'll also be able to call ServiceStack Services directly.

Community
  • 1
  • 1
mythz
  • 141,670
  • 29
  • 246
  • 390