public void SendMessage(string msg, int fromUserId, int toUserId) { ShriVivah.Models.Entities.tblMessages objmsg = new Models.Entities.tblMessages() { FromUserId = fromUserId, ToUserId = toUserId, MessageText = msg, IsDelete = false, }; objData.tblMessages.Add(objmsg); objData.SaveChanges(); //Clients.All.readMessage(ReadMessage(toUserId)); }
public ActionResult SendMessage(int fromUserId, int toUserId, string msg) { ShriVivah.Models.Entities.tblMessages objmsg = new Models.Entities.tblMessages() { FromUserId = fromUserId, ToUserId = toUserId, MessageText = msg, IsDelete = false, MessageDate = DateTime.Now.Date }; objData.tblMessages.Add(objmsg); objData.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); //Clients.All.readMessage(ReadMessage(toUserId)); }