I want smth. like this. When user types mydomain.com/Message/ he gets all his message threads, but when he types mydomain.com/Message/John he gets message thread between him and john. I Don't know how to implement view for this here is controller :
public ActionResult Index(String userName)
{
var user = UserRepository.GetUserByDisplayName(userName);
if (user == null || user.UserId.Equals(WebSecurity.CurrentUserId))
{
IQueryable<MessageThread> messageThreads =
MessageThreadRepository.GetMessageThreadsForUser(WebSecurity.CurrentUserId);
return View(messageThreads);
}
MessageThread thread = MessageThreadRepository.GetThreadBetweenUsers(WebSecurity.CurrentUserId, userName);
return View(thread);
}