Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        /// <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;
        }