// sets parameters for insert/update
        private Dictionary<string, object> SetParams(Position data)
        {
            Dictionary<string, object> result = new Dictionary<string, object>();

            result.Add("@name", data.Name);

            return result;
        }
 public ActionResult Edit(Position updateData, int id)
 {
     db.Update(updateData, id);
     return RedirectToAction("Index");
 }
 public ActionResult Create(Position newData)
 {
     db.Insert(newData);
     return RedirectToAction("Index");
 }
 public void Update(Position data, int id)
 {
     ExecuteNonQuery(QueryBuilder.Update(_tableName, TargetFields, id, _pkField), SetParams(data));
 }
 public void Insert(Position data)
 {
     ExecuteNonQuery(QueryBuilder.Insert(_tableName, TargetFields), SetParams(data));
 }