tah*_*ala 1 entity-framework entity-framework-ctp5
我有一个PCOO课程
public class Account
{
[Key,DatabaseGenerated(DatabaseGenerationOption.Identity)]
public string AccountId { set; get; }
public string FirstName { set; get; }
public string LastName { set; get; }
public string Email { set; get; }
}
Run Code Online (Sandbox Code Playgroud)
创建数据库时,我收到以下异常
Identity column 'AccountId' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, and constrained to be nonnullable.
Run Code Online (Sandbox Code Playgroud)
你不应该:
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid AccountId { set; get; }
Run Code Online (Sandbox Code Playgroud)
?
| 归档时间: |
|
| 查看次数: |
5799 次 |
| 最近记录: |