Exemple #1
0
        public static void Init(ChamaContext context)
        {
            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            var courses = new[]
            {
                new CourseEntity
                {
                    MaxStudents = 0,
                    Capacity    = 0,
                    Name        = "Full Course",
                    Teacher     = "Mark"
                },
                new CourseEntity
                {
                    MaxStudents = 10,
                    Capacity    = 10,
                    Name        = "English Course",
                    Teacher     = "John"
                }
            };

            foreach (var course in courses)
            {
                context.Courses.Add(course);
            }

            context.SaveChanges();
        }
Exemple #2
0
 public StudentRepository(ChamaContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #3
0
 public CourseRepository(ChamaContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #4
0
 public DataAggregator(ChamaContext dbContext)
 {
     _dbContext = dbContext;
 }