private UpdateChatViewModel CreateUpdateChatViewModel(Window dialogWindow)
        {
            var cancelChatCreationCommand = commandFactoryService.CreateCommand(CommandTypes.CloseWindowCommand);

            ((CloseWindowCommand)cancelChatCreationCommand).Window = dialogWindow;

            var addChatMemberToGroupListCommand = commandFactoryService.CreateCommand(CommandTypes.AddChatMemberToGroupListCommand);

            var updateChatCommand = commandFactoryService.CreateCommand(CommandTypes.UpdateChatComamnd);

            ((UpdateChatCommand)updateChatCommand).Window = dialogWindow;

            var promoteChatMemberCommand = commandFactoryService.CreateCommand(CommandTypes.PromoteChatMemberCommand);

            var deleteChatCommand = commandFactoryService.CreateCommand(CommandTypes.DeleteChatCommand);

            ((DeleteChatCommand)deleteChatCommand).Window = dialogWindow;

            var viewModel = new UpdateChatViewModel(
                cancelChatCreationCommand,
                addChatMemberToGroupListCommand,
                updateChatCommand,
                promoteChatMemberCommand,
                deleteChatCommand);

            return(viewModel);
        }
示例#2
0
        public async Task <IActionResult> Update(UpdateChatViewModel model)
        {
            var result = await chatService.Update(mapper.Map <Chat>(model));

            if (result.IsSuccessed)
            {
                return(Ok(result.Result));
            }

            return(BadRequest(result.ErrorMessage));
        }