namespace DataAccessLayer.Migrations
{
    using DataAccessLayer.Entities;
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<DataAccessLayer.ISDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(DataAccessLayer.ISDbContext context)
        {

            var attendanceEvent = new AttendanceEventType() { Id = 1, Name = "Příchod" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);

            attendanceEvent = new AttendanceEventType() { Id = 2, Name = "Odchod" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);

            attendanceEvent = new AttendanceEventType() { Id = 3, Name = "Začátek dovolené" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);

            attendanceEvent = new AttendanceEventType() { Id = 4, Name = "Konec dovolené" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);

            attendanceEvent = new AttendanceEventType() { Id = 5, Name = "Odchod k lékaři" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);

            attendanceEvent = new AttendanceEventType() { Id = 6, Name = "Příchod od lékaře" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);

            attendanceEvent = new AttendanceEventType() { Id = 7, Name = "Odchod na oběd" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);

            attendanceEvent = new AttendanceEventType() { Id = 8, Name = "Příchod z oběda" };
            context.AttendanceEventTypes.AddOrUpdate(attendanceEvent);
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data.
        }

    }
}
