【发布时间】:2019-11-16 12:08:16
【问题描述】:
我们知道主键通常是正整数。
使用uint 而不是int 作为数据模型类中的主键是个好主意吗?
示例:
public class Customer
{
public uint CustomerId {get;set;}
//others are omitted for the sake of simplicity.
}
【问题讨论】:
-
你太乐观了,认为 9,223,372,036,854,775,807 对你来说还不够;-)
-
@zerkms:别想了。这超出了我的想象。
-
@回收站:那就没有区别了。
-
@zerkms:我改成
uint让它更务实。 -
@回收站:如果 2,147,483,647 太少,那么值得更改。
标签: c# entity-framework