Example #1
0
        public IActionResult Create([FromBody] GetChatModel model)
        {
            var user = _userService.FindUser(User.Identity.Name);
            var chat = _chatService.CreateChat(user, model.Title);

            return(new JsonResult(chat));
        }
Example #2
0
        public JsonResult GetChat(Guid userTwoID)
        {
            chatService = new WebChatService.ChatServiceClient();
            var          userTwo     = chatService.GetUser().FirstOrDefault(x => x.Id == userTwoID);
            GetChatModel getChatUser = new GetChatModel();

            getChatUser.UserTwo = userTwo;
            return(Json(getChatUser, JsonRequestBehavior.AllowGet));
        }