public static int DeleteLocation(int id) { var db = ApplicationContext.Current.DatabaseContext.Database; var location = GetLocation(id); var args = new LocationDeletionEventArgs { Location = location }; OnDeleting(args); if (args.Cancel) { return(id); } var response = db.Delete <EventLocation>(id); var args2 = new LocationDeletedEventArgs { Location = location }; OnDeleted(args2); return(response); }
public static void OnDeleting(LocationDeletionEventArgs e) { EventHandler <LocationDeletionEventArgs> handler = Deleting; if (handler != null) { handler(null, e); } }