Beispiel #1
0
 static void UpdateCiviliteInORM(int id, string libelleCourt, string libelleLong)
 {
     using (GestContactEntities entities = new QuatriemeApplication.GestContactEntities())
     {
         var maCivilite = entities.Civilites.SingleOrDefault(civilite => civilite.Id == id);
         maCivilite.LibelleCourt = libelleCourt;
         maCivilite.LibelleLong  = libelleLong;
         entities.SaveChanges();
     }
 }
Beispiel #2
0
 static void InsertCiviliteInORM(string libelleCourt, string libelleLong)
 {
     using (GestContactEntities entities = new QuatriemeApplication.GestContactEntities())
     {
         var maCivilite = new QuatriemeApplication.Civilite()
         {
             LibelleCourt = libelleCourt, LibelleLong = libelleLong
         };
         entities.Civilites.Add(maCivilite);
         entities.SaveChanges();
     }
 }