コード例 #1
0
        public IActionResult Index(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return(View("Index", new ChatChannelsViewModel()
                {
                    ChatChannels = _chatChannelRepository.GetAll()
                }));
            }

            else
            {
                return(View("Channel", new ChatChannelViewModel()
                {
                    Channel = id,
                    Messages = _chatMessageRepository.GetByChannel(id)
                }));
            }
        }