Example #1
0
 public void AddEmployee(Employee employee)
 {
     //the following line is where I'd use dependency injection
     //scan configured assemblies and look for class than implements a type of interface (or has an particular attribute)
     IEmployeeRepository repository = new EmployeeRepository();
     repository.Add(employee);
 }
Example #2
0
        public void TestAddNewEmployeeRecord()
        {
            var employer = new Employee
            {
              EmployedDate = DateTime.Now,
            FirstName = "Zahir",
            LastName  = "Jacobs",
            BirthDate= new DateTime(1940,1,1),
            EmployeeNum = Guid.NewGuid().ToString("N").Substring(0,15),
            TerminationDate = new DateTime(1911,1,1) //not recommended, rather make type nullable but not time refigure how to define that in nhibernate

            };
            IEmployeeRepository repository = new EmployeeRepository();
            repository.Add(employer);
        }