public void TestMethod1() { for (int i = 1; i <= 1; i++) { var st = new Souler { Title = "铁达尼号纯节奏", Img = "Images/" + i + ".jpg", Audio = "http://m6.songtaste.com/201507121623/0bd9ab34c611757e56da6a10607c9b49/6/60/60dad63d6ff68646e20031305dc85abd.mp3", Summary = "Heart of the Ocean [Radio Mix] -- Mythos 'N DJ Cosmo, 用音乐雷达搜到的,www.doreso.cn", Comment = i, Views = i, Applaud = i, Shared = i, Enable = true, Colors = "#233222", AddTime = DateTime.Now, ShowType = (int)ShowType.SetDefault }; var result = LDO<Souler>.Add(st); //var result2 = LDO<Souler>.Delete(i); } //var one = LDO<Souler>.Get(5008); var q = LiteDB.Query.All("AddTime",-1); var list = LDO<Souler>.GetPage(q,2,5); Assert.IsTrue(1==1); }
public ActionResult Add(Souler souler) { if (string.IsNullOrEmpty(souler.Summary)) souler.Summary = "天总会黑,天黑前能明白就好。 - 心灵旅客"; if (string.IsNullOrEmpty(souler.Title)) souler.Title = "未命题"; souler.Comment = 0; souler.Views = 0; souler.Applaud = 0; souler.Shared = 0; souler.AddTime = DateTime.Now; souler.Enable = true; var res = svc.Add(souler); if (res > 0) return Json(new { res = "添加成功" }); return Json(new { data = "添加失败" }); }
public int Add(Souler souler) { return LDO<Souler>.Add(souler); }