public EmployeeWithJobDuties EmployeeGetByIdWithDetail(int id)
{
// Attempt to fetch the object
var o = ds.Employees.Include("JobDuties").SingleOrDefault(e => e.Id == id);
// Return the result, or null if not found
return (o == null) ? null : Mapper.Map<EmployeeWithJobDuties>(o);
}