protected override void OnModelCreating(ModelBuilder modelBuilder) { //Composite Key modelBuilder.Entity <PassengerRegistration>() .HasKey(o => new { o.ID, o.PassengerID }); modelBuilder.Entity <DriverRegistration>() .HasKey(o => new { o.ID, o.DriverID }); CountryName countryName = new CountryName(); countryName.CountryNameData(modelBuilder); StateName stateName = new StateName(); stateName.StateNameData(modelBuilder); DistrictName districtName = new DistrictName(); districtName.DistrictNameData(modelBuilder); }