Exemplo n.º 1
0
        internal static void Initialize(TimesheetContext context)
        {
            var initializer = new DataInitializer();

            var departments = initializer.GetDepartments();

            foreach (var department in departments)
            {
                context.Departments.Add(department);
            }
            context.SaveChanges();

            var timesheets = initializer.GetTimesheetsMock();

            foreach (var timesheet in timesheets)
            {
                context.Timesheets.Add(timesheet);
            }
            context.SaveChanges();
        }
 protected override void Seed(TimesheetContext context)
 {
     DataInitializer.Initialize(context);
     base.Seed(context);
 }