我有以下三种模式:
namespace Company.Model {
class Country
{
public int CountryId { get; set; }
public string CountryName { get; set; }
} }
和
namespace Company.Model
{
class Employee
{
public int EmployeeId { get; set; }
public string EmployeeFirstName { get; set; }
public string EmployeeMiddleName { get; set; }
public string EmployeeLastName { get; set; }
public DateTime? EmployeeDOB { get; set; }
public char? EmployeeGender { get; set; }
public string EmployeeAddress { get; set; }
public int? EmployeeContactNumber { get; set; }
public string EmployeeEmailID { get; set; }
public DateTime? EmployeeJoiningDate { get; set; }
public DateTime? EmployeeConfirmationDate { get; set; }
public DateTime? EmployeeExpectedInTime { get; set; }
public DateTime? EmployeeExpectedOutTime { get; set; }
public bool? EmployeeIsResigned { get; set; }
public double? EmployeeSalary { get; set; }
public string EmployeeDesignation { get; set; }
public int? DepartmentId { get; set; }
public int? CountryId { get; set; }
}
}
和
namespace Company.Model
{
class Department
{
public int DepartmentId { get; set; }
public string DepartmentName { get; set; }
}
}
现在我需要根据Employee.CountryId = Country.CountrId和Employee.DepartmentId = Department.DepartmentId的条件将所有三个组合成一个视图模型。
我基本上想要在表格上加入,以便获得每个员工的国家名称和部门名称。