Пример #1
0
        public ActionResult CreateChat(string username)
        {
            Chat c = new Chat();

            chatService.AddChat(c);

            ApplicationUser currentUser  = accountService.getUserByName(User.Identity.Name);
            ApplicationUser userChatWIth = accountService.getUserByName(username);

            chatService.AddUserToChat(c, currentUser);
            chatService.AddUserToChat(c, userChatWIth);

            string url = this.Request.UrlReferrer.AbsoluteUri;

            return(Redirect(url));
        }