Пример #1
0
 public static EmployeeDto Map(Employee model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new EmployeeDto
     {
         Id = model.Id,
         Name = model.Name,
         Phone = model.Phone,
         Active = model.Active,
         Specialty = SpecialtyMapper.Map(model.Specialty),
         Type = TypeMapper.Map(model.Type),
         ManagerID = model.ManagerID,
         Manager = EmployeeMapper.Map(model.Manager),
         Department = DepartmentMapper.Map(model.Department),
         RowVersion = model.RowVersion,
     });
 }
Пример #2
0
 public static Employee Map(EmployeeDto dto)
 {
     if (dto == null)
     {
         return(null);
     }
     return(new Employee
     {
         Id = dto.Id,
         Name = dto.Name,
         Phone = dto.Phone,
         Active = dto.Active,
         Specialty = SpecialtyMapper.Map(dto.Specialty),
         Type = TypeMapper.Map(dto.Type),
         ManagerID = dto.ManagerID,
         Manager = EmployeeMapper.Map(dto.Manager),
         Department = DepartmentMapper.Map(dto.Department),
         RowVersion = dto.RowVersion
     });
 }