예제 #1
0
        /// <summary>
        /// Methode zum Loeschen eines Spiels
        /// </summary>
        public static void DeleteSpiel(int spielId)
        {
            if (spielId < 0)
                throw new ArgumentNullException("spielId");

            using (var context = new WM2010Entities())
            {
                var so = CqSpiel.Invoke(context, spielId);
                if (so == null)
                    throw new ObjectNotFoundException("Spiel");

                context.DeleteObject(so);
                context.SaveChanges();
            }
        }