public void ApplyEvent(CategoryUpdatedEvent categoryUpdated)
 {
     this.Id          = categoryUpdated.Id;
     this.Name        = categoryUpdated.Name;
     this.Description = categoryUpdated.Description;
     this.SortOrder   = categoryUpdated.SortOrder;
 }
        public void Update(Category cc)
        {
            var c = new CategoryUpdatedEvent(cc.UniqueId, cc.Name,
                                             cc.DisplayName, cc.WhatWeAreLookingFor,
                                             cc.Version);

            ApplyChange(c);
        }
示例#3
0
 private void Handle(CategoryUpdatedEvent evnt)
 {
     _name   = evnt.Name;
     _url    = evnt.Url;
     _thumb  = evnt.Thumb;
     _type   = evnt.Type;
     _isShow = evnt.IsShow;
     _sort   = evnt.Sort;
 }
 private void Apply(CategoryUpdatedEvent e)
 {
     Version             = e.Version++;
     Name                = e.Name;
     DisplayName         = e.DisplayName;
     UniqueId            = e.UniqueId;
     WhatWeAreLookingFor = e.WhatWeAreLookingFor;
     this.Key            = e.UniqueId.GetAggregateKey();
 }
示例#5
0
        public override async Task <ExecutionStatus> HandleEvent(DomainEvent @event)
        {
            CategoryUpdatedEvent categoryCreateEvent = @event as CategoryUpdatedEvent;

            var category = _mapper.Map <Category>(categoryCreateEvent);

            var execution = await
                            _zEsCategoryRepository.UpdateByUniqueIdAsync(category);

            return(execution);
        }
示例#6
0
 public Task <AsyncTaskResult> HandleAsync(CategoryUpdatedEvent evnt)
 {
     return(TryUpdateRecordAsync(connection =>
     {
         return connection.UpdateAsync(new
         {
             Name = evnt.Name,
             Url = evnt.Url,
             Thumb = evnt.Thumb,
             Type = (int)evnt.Type,
             IsShow = evnt.IsShow,
             Sort = evnt.Sort,
             Version = evnt.Version
         }, new
         {
             Id = evnt.AggregateRootId,
             //Version = evnt.Version - 1
         }, ConfigSettings.CategoryTable);
     }));
 }
示例#7
0
        public Task Handle(CategoryUpdatedEvent message, CancellationToken cancellationToken)
        {
            // Send some notification e-mail or another thing

            return(Task.CompletedTask);
        }
 public Task Handle(CategoryUpdatedEvent notification, CancellationToken cancellationToken)
 {
     return(Task.CompletedTask);
 }