Hans Karlsen (talk | contribs) No edit summary |
Hans Karlsen (talk | contribs) |
||
Line 15: | Line 15: | ||
[[MVC_White_paper_in_4_parts]] | [[MVC_White_paper_in_4_parts]] | ||
=== New MVC Notes Autumn 2021 === | |||
New nuget packages for .net5 and .netStandard are published on nuget and named MDriven.* | |||
To get a package into a EcoSpace by code add an attribute to EcoSpace like [EcoSpacePackage(typeof(Package1Package))] | |||
To get binding a codegen ViewModel to work go like this: | |||
public IActionResult View([ModelBinder(typeof(VMClassBinder))] SampleViewModel value) | |||
{ | |||
return View("View"); | |||
} | |||
To supress the bogus validation done on VMClass go like this: | |||
var mvc = services.AddMvc(options => | |||
{ | |||
options.ModelMetadataDetailsProviders.Add(new SuppressChildValidationMetadataProvider(typeof(VMClass))); | |||
}); // to avoid validation of the complete world by following VMClass refs |
Revision as of 16:18, 10 October 2021
The Turnkey WebApplication uses MVC for index and login pages - it defaults to angularjs for all other pages. To get MVC on other pages you must set tagged value MVC=true on ViewModel.
MVC works differently from Angular in a number of ways - the main differences are these:
- Grid-row-clicks, in MVC select of row is done if there are zero or many actions, but if there is 1 action (defined in ViewModel) this action is executed on row click
- MVC never shows a popup menu of multiple actions as angular does
How to build MVC apps with MDrivenFramework
MVC_Generated_ViewModel_UI_in_MDrivenFramework
Comboboxes_in_MVC_from_model_driven_ViewModel
Getting_started_template_for_MDriven_MVC
New MVC Notes Autumn 2021
New nuget packages for .net5 and .netStandard are published on nuget and named MDriven.*
To get a package into a EcoSpace by code add an attribute to EcoSpace like [EcoSpacePackage(typeof(Package1Package))]
To get binding a codegen ViewModel to work go like this:
public IActionResult View([ModelBinder(typeof(VMClassBinder))] SampleViewModel value) { return View("View"); }
To supress the bogus validation done on VMClass go like this:
var mvc = services.AddMvc(options => { options.ModelMetadataDetailsProviders.Add(new SuppressChildValidationMetadataProvider(typeof(VMClass))); }); // to avoid validation of the complete world by following VMClass refs