예제 #1
0
 public void Testtt()
 {
     var repository = RepoDict;
     var rst        = new DictInfo()
     {
         DictName   = "哈哈哈",
         DictType   = 99,
         Remark     = "啪啪",
         CreateTime = DateTime.Now,
         OrderNum   = OrderEnum.optionA,
         Deleted    = false
     };
     var count = repository.AddTrans(new DictInfo[] { rst });
 }
예제 #2
0
        public void TestUpdateModelField()
        {
            var repository = RepoDict;
            var ddxx       = new DictInfo()
            {
                DictID     = 1,
                CreateTime = DateTime.Now,
                Remark     = "PHP是最好的语言"
            };
            var rst = repository.Update(ddxx, x => x.CreateTime, x => x.Remark);

            Assert.Equal(1, rst);
            var ddyy = repository.Find(1);

            Assert.Equal("PHP是最好的语言", ddyy.Remark);
        }
예제 #3
0
        public void TestUpdate()
        {
            var repository = RepoDict;
            var ddxx       = new DictInfo()
            {
                DictID     = 11,
                CreateTime = DateTime.Now,
                DictType   = 101,
                DictName   = "某层某层会议室",
                Remark     = "今天交流的内容是DapperEx使用",
                Deleted    = true,
                OrderNum   = OrderEnum.optionB
            };
            var rst = repository.Update(ddxx);

            Assert.Equal(1, rst);
            var ddyy = repository.Find(11);

            Assert.Equal("今天交流的内容是DapperEx使用", ddyy.Remark);
        }