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())); } }
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); } }
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))); } }