Skip to content

Instantly share code, notes, and snippets.

@danlister
Created May 7, 2014 06:39
Show Gist options
  • Save danlister/8ab9974ff8623c84e497 to your computer and use it in GitHub Desktop.
Save danlister/8ab9974ff8623c84e497 to your computer and use it in GitHub Desktop.
@using umbraco.cms.businesslogic.media
@{
SaveMedias(Media.GetRootMedias());
}
@functions
{
public void SaveMedias(Media[] medias)
{
if (medias == null || !medias.Any())
return;
foreach (var media in medias)
{
Response.Write("Saving " + media.Text + "/n");
media.Save();
SaveMedias(media.Children);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment