modelsbuilder / ModelsBuilder.Original

The Community Models Builder for Umbraco
MIT License
114 stars 49 forks source link

EnableFactory = false, new Views still inherit from generated models #97

Closed Jeavon closed 8 years ago

Jeavon commented 8 years ago

We have this in web.config

    <add key="Umbraco.ModelsBuilder.EnableFactory" value="false" />

But still when creating a document type, the created View has inheritance like this:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.StandardPage>

I think it should not have the generated model?

zpqrtbnk commented 8 years ago

Interesting. In ModelsBuilder is enabled, but the factory is not... you are going to generate models that you will not use. The idea is that you are probably supplying your own factory of some sort, otherwise models would be entirely disabled. And so, we still generate views with the generated model.

I understand it can be discussed... ?

Jeavon commented 8 years ago

Yes, we want to use our own ViewModels and have our own Controllers convert the ModelBuilder generated "domain" models into our ViewModel whatever they may be. It's easy enough to change the View inheritance but with the ModelBuilder factory disabled I would not expect it to when creating a new view.....?

zpqrtbnk commented 8 years ago

Make sense. No factory... no models in the template... full stop.

Jeavon commented 8 years ago

Thanks!