Skip to content

Instantly share code, notes, and snippets.

@ebalders
Created August 27, 2015 20:24
Show Gist options
  • Save ebalders/8c04a64516aeb8437cc0 to your computer and use it in GitHub Desktop.
Save ebalders/8c04a64516aeb8437cc0 to your computer and use it in GitHub Desktop.
foreach (var lp in c.LessonPlans)
{
var copy = new LessonPlan(lp.Name, lp.Organization)
{
Association = lp.Association,
Category = lp.Category,
Class = null,
Course = c2,
Description = lp.Description,
EstimatedDate = lp.EstimatedDate,
EstimatedTime = lp.EstimatedTime,
OrderNumber = lp.OrderNumber
};
var files = new FileDao(Session).GetForObject(lp).Execute(Session).ToList();
var bll = new FileBll(Session);
foreach (var of in files)
{
Object2File o2f = new Object2File(copy, of.File);
Session.Save(o2f);
}
Session.Save(copy);
c2.LessonPlans.Add(copy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment