I have an Employee class with a Name property of class Name and a Contact property of type Contact. The Name class has two string properties: FirstName and LastName and the Contact class has properties like PhoneNumber and EmailAddress.
All of the data is found in one table and assume that it cannot be changed. What would my maps look like so I can load an Employee based on id and populate the Contact and Name properties with their appropriate values? Or is this even possible?
public class Employee
{
//Constructor ommitted.
public virtual Name Name { get; set; }
public virtual Contact ContactInfo { get; set; }
}
public class Name
{
// Constructor omitted.
public string FirstName { get; set; }
public string LastName { get; set; }
}
The Employee table has the following columns: EmployeeId, FirstName, LastName, plus various contact information.
Thanks!