ITimeU.Models.AthleteClassModel.DeleteIfExists C# (CSharp) Method

DeleteIfExists() public static method

public static DeleteIfExists ( string name ) : void
name string
return void
        public static void DeleteIfExists(string name)
        {
            try
            {
                AthleteClass athleteClassDb = entitiesStatic.AthleteClasses.Single(temp => temp.Name == name);
                entitiesStatic.AthleteClasses.DeleteObject(athleteClassDb);
                entitiesStatic.SaveChanges();
            }
            catch (InvalidOperationException)
            {
                // No DB entry found, do noting
            }
        }