using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StudentDAL.Interfaces;
using StudentDAL.Migrations;
using StudentModels;

namespace StudentDAL
{
    public class StudentContext : DbContext, IDbContext
    {
        public StudentContext()
            : base("name=StudentDBConnection")
        {
            //Database.SetInitializer(new DropCreateDatabaseIfModelChanges<StudentContext>());
            Database.SetInitializer(
                new MigrateDatabaseToLatestVersion<StudentContext,MigrationConfiguration>());
        }

        public DbSet<Person> Persons { get; set; }
        public DbSet<StudySubject> StudySubjects { get; set; }
        public DbSet<PersonInStudySubject> PersonInStudySubjects { get; set; }
    }
}
