-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData.cs
More file actions
52 lines (46 loc) · 2.18 KB
/
Data.cs
File metadata and controls
52 lines (46 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Data.Entity;
namespace DXSample.Data {
public class SchedulingContext : DbContext {
public DbSet<AppointmentEntity> Appointments { get; set; }
public DbSet<ResourceEntity> Resources { get; set; }
}
public class AppointmentEntity {
public int Id { get; set; }
public string Subject { get; set; }
public string Description { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public int AppointmentType { get; set; }
public string RecurrenceInfo { get; set; }
public int ResourceId { get; set; }
public int Label { get; set; }
}
public class ResourceEntity {
public int Id { get; set; }
public string Description { get; set; }
}
public class SchedulingContextInitializer : DropCreateDatabaseIfModelChanges<SchedulingContext> {
protected override void Seed(SchedulingContext context) {
base.Seed(context);
context.Resources.Add(DataHelper.Personal());
context.Resources.Add(DataHelper.Education());
context.Resources.Add(DataHelper.Work());
context.Appointments.AddRange(DataHelper.Gym());
context.Appointments.Add(DataHelper.Dentist());
context.Appointments.Add(DataHelper.Dinner());
context.Appointments.Add(DataHelper.Disneyland());
context.Appointments.Add(DataHelper.RR());
context.Appointments.Add(DataHelper.DayOff());
context.Appointments.Add(DataHelper.SecondShift());
context.Appointments.Add(DataHelper.ConferenceCompanyMeeting());
context.Appointments.Add(DataHelper.ConferenceCustomerRetentionReview());
context.Appointments.Add(DataHelper.ConferenceDatabaseAndWebsiteReview());
context.Appointments.Add(DataHelper.ConferenceWeeklyMeeting());
context.Appointments.Add(DataHelper.TrainingFrenchLesson());
context.Appointments.Add(DataHelper.TrainingGermanLesson());
context.Appointments.Add(DataHelper.TrainingTrainStaffOnNewRemoteControls());
context.SaveChanges();
}
}
}