Ejemplo n.º 1
0
 protected override HashCodeBuilder CalculateHashCode()
 {
     return(HashCodeBuilder
            .CreateNew()
            .Add(EmployeeId.GetHashCodeBuilder())
            .Add(Name.GetHashCodeBuilder())
            .Add(Address.GetHashCodeBuilder()));
 }
Ejemplo n.º 2
0
        protected Employee(EmployeeId employeeId, Name name, Address address)
        {
            employeeId.EnsureNotNull("Employee id must not be null.");
            name.EnsureNotNull("Employee name must not be null.");
            address.EnsureNotNull("Employee address must not be null.");

            EmployeeId = employeeId;
            Name       = name;
            Address    = address;
        }
 public static SalaryEmployee CreateNew(EmployeeId employeeId, Name name, Address address, Money salary)
 {
     return(new SalaryEmployee(employeeId, name, address, salary));
 }
        protected SalaryEmployee(EmployeeId employeeId, Name name, Address address, Money salary) : base(employeeId, name, address)
        {
            salary.EnsureNotNull("Employee salary must not be null.");

            Salary = salary;
        }
 public static HourlyEmployee CreateNew(EmployeeId employeeId, Name name, Address address, HourlyRate rate)
 {
     return(new HourlyEmployee(employeeId, name, address, rate));
 }
 private HourlyEmployee(EmployeeId employeeId, Name name, Address address, HourlyRate rate) : base(employeeId, name, address)
 {
     rate.EnsureNotNull("Hourly rate must not be null.");
     Rate = rate;
 }
 public static CommissionEmployee CreateNew(EmployeeId employeeId, Name name, Address address, CommissionRate rate, Money salary)
 {
     return(new CommissionEmployee(employeeId, name, address, rate, salary));
 }
 private CommissionEmployee(EmployeeId employeeId, Name name, Address address, CommissionRate rate, Money salary) : base(employeeId, name, address, salary)
 {
     rate.EnsureNotNull("Commission rate must not be null.");
     Rate = rate;
 }