Esempio n. 1
0
 public static List <DAL.Reservation> LesenFremdschluesselGleich(DAL.Platz suchschluessel)
 {
     using (var context = new DAL.Context())
     {
         return((from record in context.Reservation.Include("Platz") where record.Platz.PlatzId == suchschluessel.PlatzId select record).ToList());
     }
 }
Esempio n. 2
0
 public static void Loeschen(DAL.Platz platz)
 {
     using (var context = new DAL.Context())
     {
         context.Platz.Remove(platz);
         context.SaveChanges();
     }
 }
Esempio n. 3
0
 public static void Aktualisieren(DAL.Platz platz)
 {
     using (var context = new DAL.Context())
     {
         //TODO null Checks?
         context.Entry(platz).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Esempio n. 4
0
 public static Int64 Erstellen(DAL.Platz platz)
 {
     if (platz.Name == null || platz.Name == "")
     {
         platz.Name = "leer";
     }
     using (var context = new DAL.Context())
     {
         context.Platz.Add(platz);
         context.SaveChanges();
         return(platz.PlatzId);
     }
 }