【发布时间】:2015-02-26 07:23:56
【问题描述】:
我已在我的 Azure 移动服务项目中激活迁移。我在迁移的 Configuration.cs 类中填充了新的种子函数。如果表为空,则种子函数运行没有任何问题。当我的 AddorUpdate 尝试更新第一个对象时,我在内部异常中收到错误:“不支持使用 'Identity' 模式修改列。列:'CreatedAt'。表:'CodeFirstDatabaseSchema.Category'。”
我的部分代码如下:
context.categories.AddOrUpdate(
new Category { Id="1", Code="GEN", Text="General"},
new Category { Id="2", Code="POL", Text="Politics"},
new Category { Id="3", Code="FAS", Text="Fashion"},
new Category { Id="4", Code="PEO", Text="People"},
new Category { Id="5", Code="TEC", Text="Technology"},
new Category { Id="6", Code="SPO", Text="Sport"},
new Category { Id="7", Code="LIV", Text="Living"}
);
【问题讨论】:
标签: c# entity-framework azure azure-mobile-services