0
在数据库表中的“设备”有一栏“状态”(整数)排序映射字符串,而不是整数
Name | Status ---------------- Device1 1 Device2 2 Device3 3 Device4 4 Device5 3
在我的应用我有映射列“状态”,以人类可读的话(串)
public enum Status
{
Start = 1,
Stop = 2,
Running = 3,
new Device = 4,
}
如果我按“状态”命令,结果将按整数排序。
_repository.Query<Device>().OrderBy(c=>c.status)
.Skip(skip)
.Take(500);
在表中 “设备” 我有超过60.000的记录,所以我使用分页
结果:
Name | Status ------------------ Device1 Start Device2 Stop Device3 Running Device5 Running Device4 new Device
我需要什么:
Name | Status ------------------ Device4 new Device Device3 Running Device5 Running Device1 Start Device2 Stop
什么我可不可以做?
感谢,这个伟大工程 – supersonic