Skip to content

Instantly share code, notes, and snippets.

@jbreuer
Created August 28, 2014 08:18
Show Gist options
  • Save jbreuer/76d802851346b991af26 to your computer and use it in GitHub Desktop.
Save jbreuer/76d802851346b991af26 to your computer and use it in GitHub Desktop.
Nested Archetype. Doesn't seem to work.
var archetypeModel = this.GetPropertyValue<ArchetypeModel>("tourLocations");
return archetypeModel.Select(x =>
{
return new TourLocation()
{
Name = x.GetValue<string>("name"),
Translations = x.GetValue<ArchetypeModel>("translations").Select(y =>
{
return new Translation()
{
Language = y.GetValue<string>("language"),
TranslationValue = y.GetValue<string>("translation"),
};
}
),
StartDate = x.GetValue<DateTime>("startDate"),
EndDate = x.GetValue<DateTime>("endDate"),
Link = x.GetValue<UrlPicker.Umbraco.Models.UrlPicker>("link"),
AllowOption = GetAllowOption(x.GetValue<Picker>("allowOption")),
AllowLanguages = x.GetValue<ArchetypeModel>("allowLanguages").Select(y => y.GetValue<string>("name")),
Location = x.GetValue<GoogleMaps>("location")
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment