Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
 // private readonly IMapper _mapper;
 public EmployeeRepository(EmployeeMISContext context, IMapper mapper)
 {
     _context = context;
     // _mapper = mapper;
 }
Exemplo n.º 3
0
 // private readonly IMapper _IMapper;
 public DepartmentRepository(EmployeeMISContext context, IMapper mapper)
 {
     _context = context;
     // _IMapper = mapper;
 }
 public EmployeeDocumentController(EmployeeMISContext context)
 {
     _context = context;
 }