As a simplified example, I have the following data classes:
public class Employee
{
public string FirstName { get; set; }
public string LastName { get; set; }
public Position Position { get; set; }
}
public class Position
{
public string Title { get; set; }
public string Description { get; set; }
public decimal Salary { get; set; }
}
In the database (let's say Sql Server), I have the following tables:
Table: Employees
Column: EmployeeID (unique, primary key)
Column: FirstName
Column: LastName
Column: Positions_PositionID (foreign key)
Table: Positions
Column: PositionID (unique, primary key)
Column: Title
Column: Salary
What options are available to me so that I can 'copy' the tables in the database into a, say, IQueryable<Employee>
list?