Feature Request: Provide a way to let user decide which FreshPageModelWrapper used
See original GitHub issueBased upon Pullrequest #70 and #71
The motivation was that PageModel should be use Page name extension and ViewModel should be use View as name Extension. Because of a typo the ViewModel uses the Page name extension also. #70
Simple replacement of Page to View is not possible because it would be break a lot of application without update the code of the apps. (it make sense, or not) #71
looks to me like a workaround to solve the problem.
My Question (remember i am new on C#):
Why we could not simple use the IoC Pattern here? and let the user the choice to register a own Mapper?
public static IFreshPageModelMapper PageModelMapper { get; set; } = new FreshPageModelMapper();
With IoC ?
public static IFreshPageModelMapper PageModelMapper { get; set; } = FreshIOC.Container.Resolve<IFreshPageModelMapper>();
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top GitHub Comments
It is not clear in the documentation that you cannot have a naming convention of *ViewModel and *View. After stumbling around a while I realized I needed
.Replace ("ViewModel", "View");
and NOT.Replace ("ViewModel", "Page");
would work, but requires configuration. i’d expect it to “just work”.
and although it does not make much of a difference if things are called view or page, it just makes it easier for users – even more for users of other frameworks using “convention over configuration”.
we won’t be the last ones to stumble upon this, so hopefully something will happen about it… 😃