public static void seedData(EmployeeMISContext context) { System.Console.WriteLine("Appling Migrations....."); context.Database.Migrate(); if (!context.Department.Any()) { System.Console.WriteLine("Seeding Data......."); context.Department.AddRange( new Department() { DepartmentName = "Administrator" }, new Department() { DepartmentName = "Management" }, new Department() { DepartmentName = "Development" }, new Department() { DepartmentName = "Designing" }, new Department() { DepartmentName = "Testing" } ); context.SaveChanges(); } else { System.Console.WriteLine("Data Already Exists - Not Seeding"); } }
// private readonly IMapper _mapper; public EmployeeRepository(EmployeeMISContext context, IMapper mapper) { _context = context; // _mapper = mapper; }
// private readonly IMapper _IMapper; public DepartmentRepository(EmployeeMISContext context, IMapper mapper) { _context = context; // _IMapper = mapper; }
public EmployeeDocumentController(EmployeeMISContext context) { _context = context; }