ServiceStack OrmLite: Use default database constraint instead of null value from data model
我对这些技术还很陌生。我遇到了一个小问题,可以通过编写一些惰性代码来解决这个问题……但是OrmLite和ServiceStack简化了很多事情,我想知道是否有更好的方法可以做到这一点。
因此,我有一个数据模型:
1 2 3 4 5 6 7 8 | public class cctv_camera { [AutoIncrement] public int I_id { get; set; } public string I_sid { get; set; } public string C_store_id { get; set; } // .... others } |
此数据模型映射到一个表cctv_camera。从此表进行某些联接后,还有另一种模型(称为CamDetail)被发送到客户端。我们正在POST上从客户端接收回CamDetail对象,以将其保存到数据库,并使用数据(
就是这样:
忽略此列是否有任何方法可以
我们添加了一个明确的
在v4.5.13之前,您可以使用
1 2 3 4 5 6 7 8 9 | public class cctv_camera { [AutoIncrement] public int I_id { get; set; } [Compute] public string I_sid { get; set; } public string C_store_id { get; set; } // .... others } |