【发布时间】:2018-11-07 13:47:34
【问题描述】:
这是我的员工对象
public class Employee : BaseEntity
{
public Employee()
{
this.HistoryOfStatuses = new List<Checkinout>();
}
public string Name { get; set; }
public string Department { get; set; }
public string CardNumber { get; set; }
public string Status { get; set; }
public Checkinout ActualCheckinStatuse { get; set; }
public List<Checkinout> HistoryOfStatuses { get; set; }
public int UserId { get; internal set; }
//test
}
}
这是我的控制器
HistoryOfStatuses = (from checkinout in context.Checkinout
join status in context.Status on checkinout.CheckType equals status.Statusid
where checkinout.Userid == userinfo.Userid
orderby checkinout.CheckTime descending
select new Checkinout
{
CheckStatus = status.StatusText,
CheckTime = checkinout.CheckTime
}).ToList()
这是我的 Checkinout 课程
public class Checkinout: BaseEntity
{
public Checkinout() {
}
public int EmployeeId { get; set; }
public string CheckStatus { get; set; }
public DateTime CheckTime { get; set; }
public Employee EmployeeObject { get; set; }
}
这是我的观点,我不能使用 CheckStatus 或 CheckTime
【问题讨论】:
-
请在您的屏幕截图中包含该错误消息,作为您问题的一部分,而不是在链接中
-
包含 Checkinout 类的代码
-
也许这有帮助 - w3schools.com/asp/razor_cs_loops.asp