我的 poco 课程如下;
public class FilterParameter
{
public int Id { get; set; }
[Required]
public virtual UserFeatureSetting UserFeatureSetting { get; set; }
[Required]
[MaxLength(450)]
public String ParameterName { get; set; }
public object ParameterValue { get; set; }
}
但生成的迁移代码没有创建 ParameterValue 字段。
CreateTable("dbo.FilterParameters", c => new {
Id = c.Int(nullable: false, identity: true),
ParameterName = c.String(nullable: false, maxLength: 450),
UserFeatureSetting_Id = c.Int(nullable: false),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.UserFeatureSettings", t => t.UserFeatureSetting_Id, cascadeDelete: false)
.Index(t => t.UserFeatureSetting_Id);
是否有我应该使用的替代类型 - 或解决方法?