-4

I have a c# winforms solution which includes the below projects:-

  1. UI Layer
  2. BLL
  3. DataModel
  4. DAL

Now, i want to create a asp.mvc UI within the same above solution, for the same application using MVC pattern. When i searched about mvc solution architecture, mostly i found, the model, view and controllers are created in the same project. But, since i already have the model as DAL, and BLL which developed for my winforms application, how can i design the solution architecure so that i can make use of my present BLL, DataModel and DAL layers.

Or, is it better to do the mvc projects as a separate solution? In that case, i have to maintain my BLL and DAL separately na.

Please advise in this regard. Thanks Jim

Jim
  • 23
  • 6

1 Answers1

0

When i searched about mvc solution architecture, mostly i found, the model, view and controllers are created in the same project. But, since i already have the model as DAL,

You do not. What you have is the data model. The model you talk about in MVC is the VIEWmodel and is PAGE SPECIFIC. I.e. it contains the data that the Razor code needs to render the view without any further interaction with the business layer. This is not identical to your data model that lives behind the BLL.

The WHOLE MVC PROJECT replaces the UI layer. The controllers call your BLL to interact with the business logic, then put the data into ViewModels that then get rendered by the page code.

TomTom
  • 61,059
  • 10
  • 88
  • 148
  • thanks alot. do you think, its better to maintain both the winforms and mvc codes within the same solution?. – Jim Apr 05 '16 at 10:50
  • Depends on how your profject is organized. My trading platform has maybe 30 to 30 projects in one solution, among them 2 MVC portals. In this case it totally makes sense to keep them in one solution. – TomTom Apr 05 '16 at 10:58