Ejemplo n.º 1
0
        private static void Seed(FirmDbContext context)
        {
            Console.WriteLine("Please wait while the database get started");

            context.Database.EnsureDeleted();
            context.Database.Migrate();

            for (int i = 1; i <= 8; i++)
            {
                context.Employees.Add(new Employee()
                {
                    Name = new EmpName()
                    {
                        FirstName = $"FirstName_Test{i}",
                        LastName  = $"LastName_Test{i}"
                    },
                    Salary = 249m + i * i * 3 * i
                });
            }

            //For The Last Task
            for (int i = 0; i < 5; i++)
            {
                context.Employees.Add(new Employee()
                {
                    Name = new EmpName()
                    {
                        FirstName = $"Last_Task_FirstName_Emp{i}",
                        LastName  = $"Last_Task_LastName_Emp{i}"
                    },
                    Salary   = 249m + i * i * 3 * i,
                    BirthDay = new DateTime(1989 + i, 1 + i, 1 + i * 2)
                });
            }
        }
 public Employees_Methods(Mapper mapper, ref FirmDbContext context)
 {
     this.Mapper  = mapper;
     this.Context = context;
 }
Ejemplo n.º 3
0
 public Core(Mapper mapper, ref FirmDbContext context, Employees_Methods employees_Methods)
 {
     this.Mapper     = mapper;
     this.Context    = context;
     this.EmpMethods = employees_Methods;
 }