示例#1
0
        public Task Handle(DeletedEvent message, CancellationToken token)
        {
            var table = _tableService.GetTableByAggregateId(message.Id);

            _tableService.DeleteTable(table);
            return(Task.CompletedTask);
        }
示例#2
0
        public async Task DeleteAsync(params T[] items)
        {
            Throw.IfNullOrEmpty(() => items);

            await _dataProviderWrapper.DeleteAsync(items);

            DeletedEvent?.Invoke(items);
        }
示例#3
0
 /// <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);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
            }
        }
示例#10
0
 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);
 }
示例#11
0
 public void ShortcutDelete(object sender, EventArgs e)
 {
     File.Delete(path);
     DeletedEvent?.Invoke();
 }
示例#12
0
 public RegisteredEvent Delete(DeletedEvent Id)
 {
     throw new NotImplementedException();
 }
示例#13
0
        protected override async Task DeletedReplaceChangeRequestAction(DeletedEvent <VehicleToMfrBodyCode> deletedEvent)
        {
            await base.DeletedReplaceChangeRequestAction(deletedEvent);

            await ClearChangeRequestId <MfrBodyCode>(deletedEvent.ChangeRequestId);
        }
示例#14
0
 public async Task HandleAsync(DeletedEvent <VehicleToMfrBodyCode> changeRequestDeletedEvent)
 {
     await RaiseDeletedEventAction(changeRequestDeletedEvent);
 }
示例#15
0
 public async Task HandleAsync(DeletedEvent <VehicleTypeGroup> changeRequestDeletedEvent)
 {
     await RaiseDeletedEventAction(changeRequestDeletedEvent);
 }
 public async Task HandleAsync(DeletedEvent <BodyNumDoors> changeRequestDeletedEvent)
 {
     await RaiseDeletedEventAction(changeRequestDeletedEvent);
 }
示例#17
0
 /// <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);
 }
示例#19
0
 public void Apply(DeletedEvent _)
 {
     IsDeleted = true;
 }
示例#20
0
 public async Task HandleAsync(DeletedEvent <VehicleToWheelBase> changeRequestDeletedEvent)
 {
     await RaiseDeletedEventAction(changeRequestDeletedEvent);
 }
示例#21
0
 public void Apply(DeletedEvent aggregateEvent)
 {
     _model.IsDeleted = true;
 }
示例#22
0
 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;
 }
示例#24
0
 private void RaiseDeletedEvent()
 {
     DeletedEvent?.Invoke(this, new EventArgs());
 }
示例#25
0
文件: Table.cs 项目: xuanhnvt/nopXrms
 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);
 }
示例#28
0
        protected override async Task DeletedReplaceChangeRequestAction(DeletedEvent <VehicleToBedConfig> deletedEvent)
        {
            await base.DeletedReplaceChangeRequestAction(deletedEvent);

            await ClearChangeRequestId <BedConfig>(deletedEvent.ChangeRequestId);
        }
示例#29
0
 public async Task HandleAsync(DeletedEvent <BodyStyleConfig> changeRequestDeletedEvent)
 {
     await RaiseDeletedEventAction(changeRequestDeletedEvent);
 }