I have an entity in my EDMX that I’ve extended with a few fields in a partial class like this:
public partial class Employee
{
public string JobName {get;set;}
}
These properties are for display only. In the above example say the entity has a JobTypeID property. I wish JobName to be populated w/ the name that belongs to that JobTypeID.
Is there anyway to query the employee record in EF including the value for the JobName property w/o explicity assigning each field using select()?
The reason I ask is that there are a lot of fields in the Employee entity so I’d like to be able to take advantage of something like:
ctx.Employees.Where(e=>e.EmployeeID==employeeID).Single()
…add somehow fill in JobName too
Is this possible?
How about:
public string JobName { get { return this.JobType.Name; } }?