【发布时间】:2020-04-07 03:23:53
【问题描述】:
Sql server 表:
SomeId PK varchar(50) not null
OtherId PK int not null
我应该如何首先在 EF 6 代码中映射它?
public class MyTable
{
[Key]
public string SomeId { get; set; }
[Key]
public int OtherId { get; set; }
}
我见过一些例子,你必须为每列设置顺序,这是必需的吗?
在某处有这方面的官方文档吗?
【问题讨论】:
-
SomeId是string还是int? -
@IronMan84 这是一个字符串,我会修复它。
标签: c# sql-server entity-framework entity-framework-6