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; }
/// <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); }