umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
Other
4.49k stars 2.69k forks source link

Ability to exclude certain property types in ModelsBuilder.Embedded #7506

Closed JasonElkin closed 4 years ago

JasonElkin commented 4 years ago

Models generated by ModelsBuilder.Embedded include all properties from the content type. It would be really useful if we could ignore properties (like we can with the Umbraco.ModelsBuilder - although not necessarily the same way).

It's often useful to have custom implementations of properties to do things like provide fallback values or transform them (maybe parse a string as an enum, change a DateTime's timezone etc.). If we want to do this in core we end up with both properties in the model. i.e. MyDoc.MetaTitle and MyDoc.ActualMetaTitle.

I know I can install Umbraco.ModelsBuilder to get this functionality. However, it doesn't seem right to have to add a dependency in order to not do something.

I appreciate why this feature was removed given the way that it was implemented. As ModelsBuilder.Embedded is its own thing, I guess there are other (simpler and/or better) ways to implement this functionality - e,g, configuration or options in the back-office.

nul800sebastiaan commented 4 years ago

Sorry for the delay on this one. We currently have no plans to add more features to the core Modelsbuilder implementation and recommend using the community package instead.

I'll put this on the list of ideas for when we're looking to work on new features around core Modelsbuilder again.

nul800sebastiaan commented 4 years ago

As detailed on the other issue around this, unfortunately we won't be bringing back this feature in the core version of ModelsBuilder: https://github.com/umbraco/Umbraco-CMS/issues/7734#issuecomment-595160636