Пример #1
0
 public JsonResult ChatRefresh(ChatObject aaa)
 {
     var my_lock = new object();
     var objs = new List<ChatObject>();
     using (var db = new ObjectDatabase())
     {
         var x = db.ChatLog.Where(m => m.BoardId == aaa.BoardId);
         objs.AddRange(x.ToArray());
     }
     return Json(objs);
 }
Пример #2
0
 public JsonResult ChatAdd(ChatObject aaa)
 {
     var objs = new List<ChatObject>();
     aaa.Timestamp = DateTime.Now;
     using (var db = new ObjectDatabase())
     {
         db.ChatLog.Add(aaa);
         db.SaveChanges();
         var x = db.ChatLog.Where(m => m.BoardId == aaa.BoardId);
         objs.AddRange(x.ToArray());
     }
     return Json(objs);
 }