Closed Yuant-tobing closed 5 years ago
DatabaseContext
modelBuilder.Entity<Province>(entity => { entity.HasKey(e => e.Iso) .HasName("PK_Province_Iso"); entity.Ignore(e => e.CountryCodeNavigation); entity.Property(e => e.Iso) .HasMaxLength(4) .IsUnicode(false) .IsFixedLength() .ValueGeneratedNever(); entity.Property(e => e.Name) .IsRequired() .HasMaxLength(80); entity.HasOne(e => e.CountryCodeNavigation) .WithMany(e => e.Provinces) .HasForeignKey(e => e.CountryCode) .HasConstraintName("FK_Province_Country_CountryCode") .OnDelete(DeleteBehavior.Restrict); });
Migration data (Generated by command PMC "Add-Migration Initial")
migrationBuilder.CreateTable( name: "Provinces", columns: table => new { Iso = table.Column<string>(unicode: false, fixedLength: true, maxLength: 4, nullable: false), Name = table.Column<string>(maxLength: 80, nullable: false), CountryCode = table.Column<short>(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Province_Iso", x => x.Iso); table.ForeignKey( name: "FK_Provinces_Countries_CountryCode", column: x => x.CountryCode, principalTable: "Countries", principalColumn: "Code", onDelete: ReferentialAction.Cascade); });
- EF Core 3 Preview 3 - Net Core 3 Preview 3.
This issue tracker is for documentation For product issues, use https://github.com/aspnet/EntityFramework/issues
@Yuant-tobing See my comment here: https://github.com/aspnet/EntityFramework.Docs/issues/1135#issuecomment-475017735
DatabaseContext
Migration data (Generated by command PMC "Add-Migration Initial")
- EF Core 3 Preview 3 - Net Core 3 Preview 3.
This issue tracker is for documentation For product issues, use https://github.com/aspnet/EntityFramework/issues