public static Gruppe UpdateGruppe(Gruppe gruppe) { if (gruppe == null) throw new ArgumentNullException("gruppe"); using (var context = new WM2010Entities()) { var g = CqGruppe.Invoke(context, gruppe.GruppeId); context.ApplyPropertyChanges(g.EntityKey.EntitySetName, gruppe); context.SaveChanges(); context.Refresh(RefreshMode.StoreWins, gruppe); return gruppe; } }
/// <summary> /// Methode zum Erstellen einer Gruppe /// </summary> public static Gruppe CreateGruppe(Gruppe gruppe) { if (gruppe == null) throw new ArgumentNullException("gruppe"); using (var context = new WM2010Entities()) { context.AddToGruppe(gruppe); context.SaveChanges(); context.Refresh(RefreshMode.StoreWins, gruppe); } return gruppe; }