Пример #1
0
        private void Cascade_Deleting(object source, System.ComponentModel.CancelEventArgs e)
        {
            // Cascade delete on the dependant Contact contact types:
            Database.DeleteAll <ContactContactType>(c => c.ContactType == this);

            var dependantContacts = Database.GetList <Contact>(c => c.Type == this);

            if (dependantContacts.Any())
            {
                throw new ValidationException("This Contact type cannot be deleted because of {0} dependent Contact record(s).", dependantContacts.Count());
            }
        }
Пример #2
0
 public static Task Remove(string email, string ip)
 {
     return(Database.DeleteAll <LogonFailure>(x => x.Email == email || x.IP == ip));
 }
Пример #3
0
 /// <summary>Handles the Deleting event of this User.</summary>
 /// <param name="source">The source of the event.</param>
 /// <param name="e">The CancelEventArgs instance containing the event data.</param>
 private void Cascade_Deleting(object source, System.ComponentModel.CancelEventArgs e)
 {
     // Cascade delete the dependant Password reset tickets:
     Database.DeleteAll <PasswordResetTicket>(p => p.User == this);
 }