Skip to content

SitecoreParentAttribute

Mike Edwards edited this page Jan 24, 2019 · 2 revisions

Used to control how the current Sitecore items parent item is mapped to the model.

The return type for the property must be another Glass model or a Sitecore item.

public class MyModel{

    [SitecoreParent]
    public virtual MyOtherModel Parent { get; set; }

}

Properties

Name Type Description
EnforceTemplate SitecoreEnforceTemplate Used to enforce template checks when mapping the parent Sitecore items. The template ID is either determined by the template ID defined on the attribute or the template ID of the target model type.
TemplateId string The ID of the template to use for Template enforcement.

Do you love Glass.Mapper.Sc and want to help make it the best Sitecore ORM?

Then head over to our Patreon page today and signup to support the project.

Your help will to support the continued development of the project.

We also provide Training Courses to get you up to speed quickly with the Glass.Mapper.Sc framework. The course will teach you everything you need to know to get started.

Clone this wiki locally