假设我有以下课程。
public class Location
{
public Id { get; set;}
public Name { get; set;}
}
我有一个名为 Location 的网页,看起来像这样。
txtId
txtName
txtCountStaffWorkersAtLocation
txtCountVehiclesAtLocation
txtCountNonStaffWorkersAtLocation
txtCountetc
listViewPersonnel
listViewVehicles
现在我正在调用存储库以在视图上显示 Location 字段,但我对获取和显示其他字段数据的正确方法感到困惑。它们显然与位置类关系不大。当我从数据库设置位置类时,我是否将计数放在位置类中并填写它们?我在某个地方有一个结构对象,它只有这些计数字段吗?你们通常如何处理与域对象关系不大的页面上显示的对象?
谢谢