I have a model which has two nested classes within. I am unable to find any resources how to map this correctly.
In Sitecore the Address.cs corresponds to the template Address which has a droplink to a Market. The market contains several fields which should me mapped to Market.cs as well as a single-text field which should be mapped to Text.cs.
public class Address{
[SitecoreField(FieldName = Templates.AddressItem.Fields.Market_FieldName)]
public virtual Market Market {get; set;}
.... other properties
}
With the Market.cs model:
public class Market{
[SitecoreField(FieldName = Templates.MarketItem.Fields.MarketName_FieldName)]
public virtual Text Name {get; set}
... other properties
}
And Text.cs
public class Text{
public virtual string Text {get; set;}
public virtual bool IsStandardValue {get; set;}
... other properties
}
Obviously, directly mapping it using [SitecoreField(FieldName = Templates.AddressItem.Fields.Market_FieldName)]
does not work.
How would I map the Market
object, and the Text
object properly as well as the IsStandardValue
? (Can be gotten from Item.Field.ContainsStandardValue
.)