public List <Chat> GetChats(string username) { var user = _userRepo.GetOne(username); if (user == null) { throw new ApplicationException($"User not found: {username}"); } var chats = _chatRepo.GetUserChats(username); return(chats); }