ITimeU.ExtensionMethods.Delete C# (CSharp) Method

Delete() public static method

public static Delete ( this intermediates ) : bool
intermediates this
return bool
        public static bool Delete(this List<RaceIntermediate> intermediates)
        {
            try
            {
                using (var context = new Entities())
                {
                    foreach (var intermediate in intermediates)
                    {
                        context.DeleteObject(intermediate);
                    }
                    context.SaveChanges();
                }
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }