示例#1
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;
        }