public static List <Sample.Business.Employee> MapFromEmployeeCollection(this ReverseMapper mapper, IEnumerable <Employee> source) { List <Sample.Business.Employee> result = new List <Sample.Business.Employee>(); foreach (var item in source) { result.Add(mapper.MapFromEmployee(item)); } return(result); }
public static Sample.Business.Employee MapFromEmployee(this ReverseMapper mapper, Employee source) { if (source == null) { return(null); } else if (source is SalesPerson) { return(mapper.MapFromSalesPerson((SalesPerson)source, null)); } else { return(mapper.MapFromEmployee(source, null)); } }