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 OnDeleted(LocationDeletedEventArgs e) { EventHandler<LocationDeletedEventArgs> handler = Deleted; if (handler != null) { handler(null, e); } }