1 回答
TA贡献1817条经验 获得超14个赞
Umbraco 论坛上的好人解决了我的问题。这是我的课堂上缺失的部分:
[PrimaryKeyColumn(AutoIncrement = true, IdentitySeed = 1)]
所以我的课程最终应该是这样的:
[TableName("BlogComments")]
[PrimaryKey("Id", AutoIncrement = true)]
[ExplicitColumns]
public class BlogCommentSchema
{
[PrimaryKeyColumn(AutoIncrement = true, IdentitySeed = 1)]
[Column("Id")]
public int Id { get; set; }
[Column("BlogPostUmbracoId")]
public int BlogPostUmbracoId { get; set; }
[Column("Name")]
public string Name { get; set; }
[Column("Email")]
public string Email { get; set; }
[Column("Website")]
public string Website { get; set; }
[Column("Message")]
[SpecialDbType(SpecialDbTypes.NTEXT)]
public string Message { get; set; }
}
}
- 1 回答
- 0 关注
- 97 浏览
添加回答
举报