Exemplo n.º 1
0
 public ActionResult Edit(MyTableModel item)
 {
     try {
         string query = "UPDATE MyTable SET Name = @Name , Value= @Value WHere Id = @Id";
         _db.Execute(query, item);
         return(RedirectToAction("Index"));
     } catch {
         return(View());
     }
 }
Exemplo n.º 2
0
 public ActionResult Create(MyTableModel item)
 {
     try {
         string query = "INSERT INTO MyTable VALUES(@Name,@Value)";
         _db.Execute(query, item);
         return(RedirectToAction("Index"));
     } catch {
         return(View());
     }
 }