public Task Handle(DeletedEvent message, CancellationToken token) { var table = _tableService.GetTableByAggregateId(message.Id); _tableService.DeleteTable(table); return(Task.CompletedTask); }
public async Task DeleteAsync(params T[] items) { Throw.IfNullOrEmpty(() => items); await _dataProviderWrapper.DeleteAsync(items); DeletedEvent?.Invoke(items); }
/// <summary> /// This methode should be invoked after the object was added to a room and the object will go out of scope. /// </summary> public virtual void Delete() { if (Room != null) { throw new NullReferenceException("An object can't be deleted if it's still part of a room."); } DeletedEvent?.Invoke(this); }
protected async Task RaiseDeletedEventAction(DeletedEvent <T> deletedEvent) { Func <DeletedEvent <T>, Task> deletedEventAction; if (_deletedEventActions.TryGetValue(deletedEvent.ChangeType, out deletedEventAction)) { await deletedEventAction(deletedEvent); } }
private void AddDeletedEvent(DeletedEvent e) { //var todo = (Todo)e.Data; var todoId = (int)e.Data; var target = todoRepo.SingleOrDefault(t => t.Id == todoId); e.Data = target; todoRepo.Remove(target); }
private void UpdatingDeletedEventTable(int id) { var NewDeletedEventInfo = new DeletedEvent(); var EventToDelete = _context.Events.FirstOrDefault(a => a.Id == id); NewDeletedEventInfo.EventName = EventToDelete.EventName; NewDeletedEventInfo.UserId = EventToDelete.UserId; NewDeletedEventInfo.EventId = EventToDelete.Id; NewDeletedEventInfo.DateDeleted = DateTime.Now; _context.DeletedEvents.Add(NewDeletedEventInfo); }
public void DeleteTodo(int todoId) { DeletedEvent newEvent = new DeletedEvent() { Data = todoId, TimeStamp = DateTime.Now, Type = EventType.Deleted, }; SaveToEventStore(newEvent); hanlder.Handle(newEvent); }
/// <summary> /// Remove the specified deletedObject. /// </summary> /// <returns>The remove.</returns> /// <param name="deletedObject">Deleted object.</param> public new bool Remove(T deletedObject) { if (deletedObject != null) { DeletedEvent?.Invoke(this, new DeletedEventArgs <T>(deletedObject)); for (int i = deletedObject.Index; i < Count; i++) { this.ElementAt(i).Index = i - 1; } return(base.Remove(deletedObject)); } return(false); }
private async Task DeletedModifyChangeRequestAction(DeletedEvent <T> deletedEvent) { var existingEntity = RepositoryService.FindAsync(Convert.ToInt32(deletedEvent.EntityId)).Result; // note: change request id is required for documentIndexer. this will eventually be cleared after indexer processing. existingEntity.ChangeRequestId = deletedEvent.ChangeRequestId; RepositoryService.Update(existingEntity); if (await Repositories.SaveChangesAsync() > 0) { // clear change request id in azure //TODO: rename RejectChangeRequestIndexerAsync to RejectOrDeleteChangeRequestIndexerAsync await DocumentIndexer.RejectChangeRequestIndexerAsync(deletedEvent.ChangeRequestId); // clear change request id in transaction table await this.ClearChangeRequestId <T>(deletedEvent.ChangeRequestId); } }
public async Task Delete() { await Task.Run(() => { var error = false; try { IO.Directory.Delete(FullPath, true); } catch (Exception exc) { SyncErrorEvent?.Invoke(exc.Message); error = true; } if (!error) { DeletedEvent?.Invoke(this); } }).ConfigureAwait(false); }
public void ShortcutDelete(object sender, EventArgs e) { File.Delete(path); DeletedEvent?.Invoke(); }
public RegisteredEvent Delete(DeletedEvent Id) { throw new NotImplementedException(); }
protected override async Task DeletedReplaceChangeRequestAction(DeletedEvent <VehicleToMfrBodyCode> deletedEvent) { await base.DeletedReplaceChangeRequestAction(deletedEvent); await ClearChangeRequestId <MfrBodyCode>(deletedEvent.ChangeRequestId); }
public async Task HandleAsync(DeletedEvent <VehicleToMfrBodyCode> changeRequestDeletedEvent) { await RaiseDeletedEventAction(changeRequestDeletedEvent); }
public async Task HandleAsync(DeletedEvent <VehicleTypeGroup> changeRequestDeletedEvent) { await RaiseDeletedEventAction(changeRequestDeletedEvent); }
public async Task HandleAsync(DeletedEvent <BodyNumDoors> changeRequestDeletedEvent) { await RaiseDeletedEventAction(changeRequestDeletedEvent); }
/// <summary> /// Оповещение об удалении элемента. /// </summary> public void IsDeleted() { DeletedEvent?.Invoke(); }
private async Task DeletedDeleteChangeRequestAction(DeletedEvent <T> deletedEvent) { // note: this has same effect as modify in transaction table await this.DeletedModifyChangeRequestAction(deletedEvent); }
public void Apply(DeletedEvent _) { IsDeleted = true; }
public async Task HandleAsync(DeletedEvent <VehicleToWheelBase> changeRequestDeletedEvent) { await RaiseDeletedEventAction(changeRequestDeletedEvent); }
public void Apply(DeletedEvent aggregateEvent) { _model.IsDeleted = true; }
public async Task HandleAsync(DeletedEvent <VehicleToBedConfig> changeRequestDeletedEvent) { await RaiseDeletedEventAction(changeRequestDeletedEvent); }
private async Task DeletedAddChangeRequestAction(DeletedEvent <T> deletedEvent) { //note: during delete CR of add request, nothing is to be done at transaction tables // do nothing return; }
private void RaiseDeletedEvent() { DeletedEvent?.Invoke(this, new EventArgs()); }
private void Apply(DeletedEvent e) { _activated = false; }
public async Task HandleAsync(DeletedEvent <Make> changeRequestDeletedEvent) { await RaiseDeletedEventAction(changeRequestDeletedEvent); }
protected virtual async Task DeletedReplaceChangeRequestAction(DeletedEvent <T> deletedEvent) { // note: this has same effect as modify in transaction table await this.DeletedModifyChangeRequestAction(deletedEvent); }
protected override async Task DeletedReplaceChangeRequestAction(DeletedEvent <VehicleToBedConfig> deletedEvent) { await base.DeletedReplaceChangeRequestAction(deletedEvent); await ClearChangeRequestId <BedConfig>(deletedEvent.ChangeRequestId); }
public async Task HandleAsync(DeletedEvent <BodyStyleConfig> changeRequestDeletedEvent) { await RaiseDeletedEventAction(changeRequestDeletedEvent); }