diff --git a/src/FlightRecorder.Data/FlightRecorder.Data.csproj b/src/FlightRecorder.Data/FlightRecorder.Data.csproj index 54be85e..1f8a8cc 100644 --- a/src/FlightRecorder.Data/FlightRecorder.Data.csproj +++ b/src/FlightRecorder.Data/FlightRecorder.Data.csproj @@ -3,11 +3,11 @@ netstandard2.1 FlightRecorder.Data - 1.0.0.1 + 1.0.0.2 Dave Walker Copyright (c) Dave Walker 2020 Dave Walker - First Release + Modifications for service implementation Flight Recorder EF Core Database Layer FlightRecorder database Flight Recorder EF Core Database Layer diff --git a/src/FlightRecorder.Data/FlightRecorderDbContext.cs b/src/FlightRecorder.Data/FlightRecorderDbContext.cs index edf0fb0..1eb9306 100644 --- a/src/FlightRecorder.Data/FlightRecorderDbContext.cs +++ b/src/FlightRecorder.Data/FlightRecorderDbContext.cs @@ -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(entity => @@ -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(entity => @@ -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(entity => @@ -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); }); diff --git a/src/FlightRecorder.Entities/Db/Aircraft.cs b/src/FlightRecorder.Entities/Db/Aircraft.cs index 8ef6b08..a1e6a9b 100644 --- a/src/FlightRecorder.Entities/Db/Aircraft.cs +++ b/src/FlightRecorder.Entities/Db/Aircraft.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; namespace FlightRecorder.Entities.Db @@ -7,11 +6,6 @@ namespace FlightRecorder.Entities.Db [ExcludeFromCodeCoverage] public partial class Aircraft { - public Aircraft() - { - Sighting = new HashSet(); - } - [Key] public long Id { get; set; } public long ModelId { get; set; } @@ -20,6 +14,5 @@ public Aircraft() public long Manufactured { get; set; } public virtual Model Model { get; set; } - public virtual ICollection Sighting { get; set; } } } diff --git a/src/FlightRecorder.Entities/Db/Airline.cs b/src/FlightRecorder.Entities/Db/Airline.cs index e2ceeb9..dd091f9 100644 --- a/src/FlightRecorder.Entities/Db/Airline.cs +++ b/src/FlightRecorder.Entities/Db/Airline.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; namespace FlightRecorder.Entities.Db @@ -7,15 +6,8 @@ namespace FlightRecorder.Entities.Db [ExcludeFromCodeCoverage] public partial class Airline { - public Airline() - { - Flight = new HashSet(); - } - [Key] public long Id { get; set; } public string Name { get; set; } - - public virtual ICollection Flight { get; set; } } } diff --git a/src/FlightRecorder.Entities/Db/Flight.cs b/src/FlightRecorder.Entities/Db/Flight.cs index 00748dd..5589375 100644 --- a/src/FlightRecorder.Entities/Db/Flight.cs +++ b/src/FlightRecorder.Entities/Db/Flight.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; namespace FlightRecorder.Entities.Db @@ -7,11 +6,6 @@ namespace FlightRecorder.Entities.Db [ExcludeFromCodeCoverage] public partial class Flight { - public Flight() - { - Sighting = new HashSet(); - } - [Key] public long Id { get; set; } public long AirlineId { get; set; } @@ -20,6 +14,5 @@ public Flight() public string Destination { get; set; } public virtual Airline Airline { get; set; } - public virtual ICollection Sighting { get; set; } } } diff --git a/src/FlightRecorder.Entities/Db/Location.cs b/src/FlightRecorder.Entities/Db/Location.cs index 50139c2..bd2b0c7 100644 --- a/src/FlightRecorder.Entities/Db/Location.cs +++ b/src/FlightRecorder.Entities/Db/Location.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; namespace FlightRecorder.Entities.Db @@ -7,15 +6,8 @@ namespace FlightRecorder.Entities.Db [ExcludeFromCodeCoverage] public partial class Location { - public Location() - { - Sighting = new HashSet(); - } - [Key] public long Id { get; set; } public string Name { get; set; } - - public virtual ICollection Sighting { get; set; } } } diff --git a/src/FlightRecorder.Entities/Db/Manufacturer.cs b/src/FlightRecorder.Entities/Db/Manufacturer.cs index 8b594cf..747e418 100644 --- a/src/FlightRecorder.Entities/Db/Manufacturer.cs +++ b/src/FlightRecorder.Entities/Db/Manufacturer.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; namespace FlightRecorder.Entities.Db @@ -7,15 +6,8 @@ namespace FlightRecorder.Entities.Db [ExcludeFromCodeCoverage] public partial class Manufacturer { - public Manufacturer() - { - Model = new HashSet(); - } - [Key] public long Id { get; set; } public string Name { get; set; } - - public virtual ICollection Model { get; set; } } } diff --git a/src/FlightRecorder.Entities/Db/Model.cs b/src/FlightRecorder.Entities/Db/Model.cs index 895a460..9e86257 100644 --- a/src/FlightRecorder.Entities/Db/Model.cs +++ b/src/FlightRecorder.Entities/Db/Model.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; namespace FlightRecorder.Entities.Db @@ -7,17 +6,11 @@ namespace FlightRecorder.Entities.Db [ExcludeFromCodeCoverage] public partial class Model { - public Model() - { - Aircraft = new HashSet(); - } - [Key] public long Id { get; set; } public long ManufacturerId { get; set; } public string Name { get; set; } public virtual Manufacturer Manufacturer { get; set; } - public virtual ICollection Aircraft { get; set; } } } diff --git a/src/FlightRecorder.Entities/FlightRecorder.Entities.csproj b/src/FlightRecorder.Entities/FlightRecorder.Entities.csproj index 83442ad..b4d18fd 100644 --- a/src/FlightRecorder.Entities/FlightRecorder.Entities.csproj +++ b/src/FlightRecorder.Entities/FlightRecorder.Entities.csproj @@ -3,11 +3,11 @@ netstandard2.1 FlightRecorder.Entities - 1.0.0.2 + 1.0.0.3 Dave Walker Copyright (c) Dave Walker 2020 Dave Walker - First Release + Updates for REST service implementation Flight Recorder Domain Models FlightRecorder domain models entities Flight Recorder Domain Models diff --git a/src/FlightRecorderDb.sln b/src/FlightRecorderDb.sln index 40a3af2..1e3908f 100644 --- a/src/FlightRecorderDb.sln +++ b/src/FlightRecorderDb.sln @@ -11,9 +11,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightRecorder.BusinessLogi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightRecorder.DataExchange", "FlightRecorder.DataExchange\FlightRecorder.DataExchange.csproj", "{2337BD55-D981-459A-ACD9-F0CFE5DCC1AA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightRecorder.Migrations", "FlightRecorder.Migrations\FlightRecorder.Migrations.csproj", "{C900A267-3486-430A-ABB5-1D25292BE450}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightRecorder.Migrations", "FlightRecorder.Migrations\FlightRecorder.Migrations.csproj", "{67B116B7-F37B-492C-B6A8-767617CC89E4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightRecorder.Users", "FlightRecorder.Users\FlightRecorder.Users.csproj", "{B17F7264-1B0D-48AA-829F-83E0E0A13670}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightRecorder.Users", "FlightRecorder.Users\FlightRecorder.Users.csproj", "{5C0B6862-4FC3-42DC-9CF0-ECBB5929A09B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -41,13 +41,13 @@ Global {2337BD55-D981-459A-ACD9-F0CFE5DCC1AA}.Debug|Any CPU.Build.0 = Debug|Any CPU {2337BD55-D981-459A-ACD9-F0CFE5DCC1AA}.Release|Any CPU.ActiveCfg = Release|Any CPU {2337BD55-D981-459A-ACD9-F0CFE5DCC1AA}.Release|Any CPU.Build.0 = Release|Any CPU - {C900A267-3486-430A-ABB5-1D25292BE450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C900A267-3486-430A-ABB5-1D25292BE450}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C900A267-3486-430A-ABB5-1D25292BE450}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C900A267-3486-430A-ABB5-1D25292BE450}.Release|Any CPU.Build.0 = Release|Any CPU - {B17F7264-1B0D-48AA-829F-83E0E0A13670}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B17F7264-1B0D-48AA-829F-83E0E0A13670}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B17F7264-1B0D-48AA-829F-83E0E0A13670}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B17F7264-1B0D-48AA-829F-83E0E0A13670}.Release|Any CPU.Build.0 = Release|Any CPU + {67B116B7-F37B-492C-B6A8-767617CC89E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67B116B7-F37B-492C-B6A8-767617CC89E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67B116B7-F37B-492C-B6A8-767617CC89E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67B116B7-F37B-492C-B6A8-767617CC89E4}.Release|Any CPU.Build.0 = Release|Any CPU + {5C0B6862-4FC3-42DC-9CF0-ECBB5929A09B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C0B6862-4FC3-42DC-9CF0-ECBB5929A09B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C0B6862-4FC3-42DC-9CF0-ECBB5929A09B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C0B6862-4FC3-42DC-9CF0-ECBB5929A09B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal