Skip to content

Instantly share code, notes, and snippets.

@mskutta
Last active September 8, 2015 16:43
Show Gist options
  • Save mskutta/462fda8afbf9ddf96e75 to your computer and use it in GitHub Desktop.
Save mskutta/462fda8afbf9ddf96e75 to your computer and use it in GitHub Desktop.
Sitecore: Automatically Save Related Items using Glass Mapper
var service = new SitecoreService("master");
var person = new Person();
person.Name = "Mike Skutta";
person.FirstName = "Mike";
person.LastName = "Skutta";
person.Education = new List<Education> { new Education
{
Name = "University of Illinois",
School = "University of Illinois",
YearOfDegree = 1999,
Degree = "BS, Mechanical Engineering"
}
};
using (new SecurityDisabler())
{
service.Create(<parent>, person);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment