public HotelContext(DbContextOptions <HotelContext> options) : base(options) { if (Agences.Count() == 0) { Agences.Add(new HotelModel.Agence { IdentifiantAgence = "hijk", MotDePasseAgence = "lmnop", Reduction = 0.75 }); SaveChanges(); } if (Chambres.Count() == 0) { Chambres.Add(new HotelModel.Chambre { NombreDeLits = 3, Surface = 40, BasePrix = 100, ImageUrl = "https://www.usine-digitale.fr/mediatheque/3/9/8/000493893/hotel-c-o-q-paris.jpg" }); Chambres.Add(new HotelModel.Chambre { NombreDeLits = 1, Surface = 100, BasePrix = 35, ImageUrl = "https://www.hotel-design-secret-de-paris.com/wp-content/uploads/2015/01/secret-de-paris-chambre-trocadero-21-md1.jpg" }); SaveChanges(); } }
public HotelContext(DbContextOptions <HotelContext> options) : base(options) { if (Agences.Count() == 0) { Agences.Add(new HotelModel.Agence { IdentifiantAgence = "abcd", MotDePasseAgence = "efgh", Reduction = 0.25 }); Agences.Add(new HotelModel.Agence { IdentifiantAgence = "hijk", MotDePasseAgence = "lmnop", Reduction = 0.5 }); SaveChanges(); } if (Chambres.Count() == 0) { Chambres.Add(new HotelModel.Chambre { NombreDeLits = 3, Surface = 20, BasePrix = 80, ImageUrl = "https://www.hotel-beaujolais.com/img/build/les-pierres-dorees-chambres.jpg" }); Chambres.Add(new HotelModel.Chambre { NombreDeLits = 5, Surface = 50, BasePrix = 100, ImageUrl = "https://assets.hotelaparis.com/uploads/pictures/000/043/953/Chambre-3-6.jpg" }); Chambres.Add(new HotelModel.Chambre { NombreDeLits = 2, Surface = 40, BasePrix = 60, ImageUrl = "https://www.hotel-diana-dauphine.com/media/cache/jadro_resize/rc/rhCiPkJe1582096951/jadroRoot/medias/5658345e8f976/chambre-1.jpg" }); SaveChanges(); } }