Last post Dec 20, 2017 01:20 AM by DA924
Dec 19, 2017 08:26 PM|cgs120|LINK
The idea is to have one base projectA that I use to create most of the sites. Separate projects for addons/plugins ex. FAQ, newsletter, gallery, etc. When site needs something more than I have in base projectA ex. gallery I would drop dll and views and use
With asp.net web forms I had class libraries - compiled to dll , and some user controls. This I could drop to any asp.net web application and easily use .
Thinking to update some of the code to mvc and trying to figure out best way to do it. Let say I have main projectA (basic code I use for most of the sites), then I have projectB - let say it is Newsletter "plugin"
If I create project as functional mvc app. and publish it, then in projectA I simply try to reference projectB.dll and copy views from projectB to projectA.
I get a lot of errors, starting with owin "The located assembly's manifest definition does not match the assembly reference" - even if I much all nugget packages in both project, then I get errors about "The OwinStartup attribute discovered in assembly 'projectB'
referencing startup type 'projectB.Startup' conflicts with the attribute....in projectA" after fixing, I get problem with routes and the list goes on....
Another problem i see is both use EF code first, so problem with migrations, etc.
The question here is: What is proper way of doing this, is there any good tutorial showing how to share mvc project (more like include on in another).The only thing i can think of is to copy views, controllers, models from projectB to projectA, run migration,
publish...this would work but ideal solution would be to have already published versions of project A, projectB, C, D, etc. and when there is need copy B to A, C to A , etc., so designer could make changes without touching the code
Dec 20, 2017 01:20 AM|DA924|LINK
Thinking to update some of the code to mvc and trying to figure out best way to do it.
For what? You can still use the ASP.NET Web forms and still implement Separation of Duties at the UI. Do you really know the purpose of MVC?
Do you know there is MVP, which can be used for ASP.NET Web form and its purpose?
In case of MVC it is controller. In case of MVP it is presenter. In case of
MVVM it is view model.
If you look at the first two characters in all the above patterns, it remain same i.e. stands for model and view. All these patterns are different but have a common objective that is
“Separation of Duties"
I encountered MVP way back in year 2007 and have used it over the years. I have also used ASP.NET MVC too over the years.
If can use MVP in a Web form solution, the what is the reasoning of going to MVC and changing the entire architectural design of the application, because that's what you are doing?
Why not just keep what you have in using ASP.NET Web forms but use MVP on Separation of Duties?
This is how I first learned about MVP.
You have different flavors of MVP.
So should one go to MVC for the sake of what, when you can use MVP that does the same thing using the UI design pattern with an existing ASP.NET Web forms solution to implement separation of duties?
Well EF code first is the cheesecake teachings that is put in front of any developer trying to learn ASP.NET MVC. IMO, an inexperienced amateur or even a professional that do not have the basics on database administration, program development against a database,
with using T-SQL and ADO.NET in a traditional sense has no business doing anything with EF code first, because they run into trouble time and time again.
The question here is: What is proper way of doing this, is there any good tutorial showing how to share mvc project (more like include on in another).The only thing i can think of is to copy views, controllers, models from projectB to projectA, run
migration, publish...this would work but ideal solution would be to have already published versions of project A, projectB, C, D, etc. and when there is need copy B to A, C to A , etc., so designer could make changes without touching the code
Maybe, you should go to MVP that allows one to scale to new technology but keep the UI in using ASP.NET Web form design.
It's just my opinion, and if I were faced with the satiation knowing both UI design patterns, myself, I would use MVP. I would use MVC for new project development.