public void TestLUpdate() { njh.list listObj = map.Get <njh.list>("select * from list where idx=20"); Assert.AreNotEqual(listObj, null); Console.WriteLine("Before Update:"); if (listObj != null) { IDictionary <string, object> dic = listObj.Serialize(); foreach (string iyem in dic.Keys) { Console.WriteLine(iyem + " = " + dic[iyem]); } } Console.WriteLine("Now Updates:"); listObj.classname = listObj.classname.Substring(2); listObj.href = listObj.href.Substring(32);; listObj.title = listObj.title.Substring(32);; map.Update <list>(listObj, "", map.Include("classname").Include("href").Columns); Console.WriteLine("After Updates:"); listObj = map.Get <njh.list>("select * from list where idx=20"); if (listObj != null) { IDictionary <string, object> dic = listObj.Serialize(); foreach (string iyem in dic.Keys) { Console.WriteLine(iyem + " = " + dic[iyem]); } } }
public void TestLEntity() { njh.list list = map.Get <njh.list>("select * from list where idx=20"); Assert.AreNotEqual(list, null); if (list != null) { IDictionary <string, object> dic = list.Serialize(); foreach (string iyem in dic.Keys) { Console.WriteLine(iyem + " = " + dic[iyem]); } } }
public void InsertTest() { Console.WriteLine(map.DbContext.ConnStr + "#" + map.DbContext.ToString()); njh.list list = new njh.list() { classname = "classname2", href = Guid.NewGuid().ToString(), idx = 1, title = "Title" + DateTime.Now.Ticks }; int i = map.Insert <njh.list>(list); Assert.AreEqual(1, i); }
public void InsertTest() { Console.WriteLine(map.DbContext.ConnStr + "#" + map.DbContext.ToString()); njh.list list = new njh.list() { classname = "classname2", href = Guid.NewGuid().ToString(), idx = 1, title = "Title" + DateTime.Now.Ticks }; int i = map.Insert<njh.list>(list); Assert.AreEqual(1, i); }