Skip to content

Commit

Permalink
Remove related entity mappings from the context
Browse files Browse the repository at this point in the history
  • Loading branch information
davewalker5 committed Apr 14, 2020
1 parent ebc863c commit c5e5365
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/FlightRecorder.Data/FlightRecorderDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.IsRequired()
.HasColumnName("serial_number")
.HasColumnType("VARCHAR(50)");
entity.HasOne(d => d.Model)
.WithMany(p => p.Aircraft)
.HasForeignKey(d => d.ModelId);
});

modelBuilder.Entity<Airline>(entity =>
Expand Down Expand Up @@ -91,10 +87,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.IsRequired()
.HasColumnName("number")
.HasColumnType("VARCHAR(50)");
entity.HasOne(d => d.Airline)
.WithMany(p => p.Flight)
.HasForeignKey(d => d.AirlineId);
});

modelBuilder.Entity<Location>(entity =>
Expand Down Expand Up @@ -139,10 +131,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.IsRequired()
.HasColumnName("name")
.HasColumnType("VARCHAR(100)");
entity.HasOne(d => d.Manufacturer)
.WithMany(p => p.Model)
.HasForeignKey(d => d.ManufacturerId);
});

modelBuilder.Entity<Sighting>(entity =>
Expand All @@ -165,18 +153,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.FlightId).HasColumnName("flight_id");
entity.Property(e => e.LocationId).HasColumnName("location_id");
entity.HasOne(d => d.Aircraft)
.WithMany(p => p.Sighting)
.HasForeignKey(d => d.AircraftId);
entity.HasOne(d => d.Flight)
.WithMany(p => p.Sighting)
.HasForeignKey(d => d.FlightId);
entity.HasOne(d => d.Location)
.WithMany(p => p.Sighting)
.HasForeignKey(d => d.LocationId);
});


Expand Down

0 comments on commit c5e5365

Please sign in to comment.