예제 #1
0
        private void Handle(StoreUpdatedEvent evnt)
        {
            var editableInfo = evnt.Info;

            _info = new StoreInfo(
                _info.AccessCode,
                editableInfo.Name,
                editableInfo.Description,
                _info.Region,
                editableInfo.Address);
            _type = editableInfo.Type;
        }
예제 #2
0
 /// <summary>
 /// 后台更新店铺信息
 /// </summary>
 /// <param name="evnt"></param>
 /// <returns></returns>
 public Task <AsyncTaskResult> HandleAsync(StoreUpdatedEvent evnt)
 {
     return(TryUpdateRecordAsync(connection =>
     {
         var info = evnt.Info;
         return connection.UpdateAsync(new
         {
             Name = info.Name,
             Description = info.Description,
             Address = info.Address,
             Type = (int)info.Type,
             Version = evnt.Version,
             EventSequence = evnt.Sequence
         }, new
         {
             Id = evnt.AggregateRootId,
             //Version = evnt.Version - 1
         }, ConfigSettings.StoreTable);
     }));
 }
 public Task Handle(StoreUpdatedEvent notification, CancellationToken cancellationToken)
 {
     _messageNotify.NotifyService(JsonConvert.SerializeObject(notification));
     return(Task.CompletedTask);
 }