public static void Initialize(IServiceProvider serviceProvider) { using (var context = new ControlAttendanceContext( serviceProvider.GetRequiredService <DbContextOptions <ControlAttendanceContext> >())) { if (context.Employee.Any()) { return; } context.Employee.AddRange( new Employee { Id = 0, Name = "Felipe Bruno Silva", Anniversary = DateTime.Parse("1989-2-12"), Email = "*****@*****.**", CPF = "140.786.139-66", NumberPhone = 992213132, Salary = 1039, AnyAddress = "Avenida babel", NumberAdress = 69, City = "Uberlândia", District = "Canaã" }); context.SaveChanges(); } }
public EmployeesController(ControlAttendanceContext context) { _context = context; }