예제 #1
0
        /// <summary>
        /// Methode zum Aendern einer Mannschaft
        /// </summary>
        public static Mannschaft UpdateMannschaft(Mannschaft mannschaft)
        {
            if (mannschaft == null)
                throw new ArgumentNullException("mannschaft");


            using (var context = new WM2010Entities())
            {
                var m = CqMannschaft.Invoke(context, mannschaft.MannschaftId);
                

                context.ApplyPropertyChanges(m.EntityKey.EntitySetName, mannschaft);
                context.SaveChanges();

                context.Refresh(RefreshMode.StoreWins, m);

                return m;
            }
        }
예제 #2
0
 /// <summary>
 /// Speichert die Mannschaft
 /// </summary>
 /// <returns></returns>
 public Mannschaft SaveMannschaft(Mannschaft mannschaft)
 {
     return WM2010Manager.UpdateMannschaft(mannschaft);
 }
예제 #3
0
        /// <summary>
        /// Methode zum Erstellen einer Mannschaft
        /// </summary>
        public static Mannschaft CreateMannschaft(Mannschaft mannschaft)
        {
            if (mannschaft == null)
                throw new ArgumentNullException("mannschaft");


            using (var context = new WM2010Entities())
            {
                context.AddToMannschaft(mannschaft);
                //context.Detach(mannschaft.Gruppe);

                context.SaveChanges();
                context.Refresh(RefreshMode.StoreWins, mannschaft);
            }

            return mannschaft;
        }