Ejemplo n.º 1
0
        public ActionResult Update()
        {
            Tabl2 model = new Tabl2()
            {
                id = 7007, AId = 1111, Name = "test2222"
            };

            using (SqlConnection cn = new SqlConnection(DapperHelper.ConnStr))
            {
                var r = cn.Update(model);
                return(Content(r.ToString()));
            }
        }
Ejemplo n.º 2
0
 public ActionResult AddBatch()
 {
     using (SqlConnection cn = new SqlConnection(DapperHelper.ConnStr))
     {
         Tabl2 model = new Tabl2()
         {
             AId = 1111, Name = "test"
         };
         Tabl2 model2 = new Tabl2()
         {
             AId = 1112, Name = "test2"
         };
         var r = cn.Insert(model);
         cn.Insert(model2);
         return(null);
     }
 }
Ejemplo n.º 3
0
 public ActionResult Add()
 {
     using (SqlConnection cn = new SqlConnection(DapperHelper.ConnStr))
     {
         Tabl2 model = new Tabl2()
         {
             AId = 1111, Name = "test"
         };
         Table4 model2 = new Table4()
         {
             Code = "ssdb", Name = "test"
         };
         var r = cn.Insert(model);
         cn.Insert(model2);
         return(Content(JsonConvert.SerializeObject(r)));
     }
 }