public virtual async Task EditInfo(Guid currentUserId, Guid chatId, TChatInfo chatInfo) { await ChatsPermissionValidator.ValidateEditInfo(currentUserId, chatId, chatInfo, ServiceName).ConfigureAwait(false); var command = ChatsCommandBuilder.BuildEditChatCommand(currentUserId, chatId, chatInfo); await ChatCommandSender.Send(command).ConfigureAwait(false); }
public virtual async Task Handle(IEditChatInfoCommand <TChatInfo> command, IChatBusContext chatEventPublisher) { await ChatsPermissionValidator.ValidateEditInfo(command.InitiatorUserId, command.ChatId, command.ChatInfo, WorkerName).ConfigureAwait(false); var chatInfo = await ChatStore.UpdateInfo(command.ChatId, command.ChatInfo, command.InitiatorUserId).ConfigureAwait(false); var @event = ChatsEventBuilder.BuildChatInfoEditedEvent(command.InitiatorUserId, command.ChatId, chatInfo); await chatEventPublisher.EventPublisher.Publish(@event).ConfigureAwait(false); }