Struktura encji Migracje nie zawierają adnotacji danych DefaultValue (EF5RC)
Mam klasę, która wygląda tak:
[Table("Subscribers", Schema = "gligoran")]
public class Subscriber
{
[Key]
public string Email { get; set; }
[Required]
[DefaultValue(true)]
public bool Enabled { get; set; }
}
Podczas tworzenia migracji do tej klasy otrzymuję:
public partial class AddSubscriberClass : DbMigration
{
public override void Up()
{
CreateTable(
"gligoran.Subscribers",
c => new
{
Email = c.String(nullable: false, maxLength: 128),
Enabled = c.Boolean(nullable: false),
})
.PrimaryKey(t => t.Email);
}
public override void Down()
{
DropTable("gligoran.Subscribers");
}
}
ChciałbymEnabled
linia wygląda tak:
Enabled = c.Boolean(nullable: false, defaultValue: true),
Oczywiście mogę to zrobić sam, ale pytam tylko, czy istnieje sposób na to, aby Entity Framework zrobiło to automatycznie.
Używam najnowszego Entity Framework 5 RC (5.0.0-rc.net40).