protected JsonResult Update <T>(IOrmModel item) { int?Pk = item.PrimaryKey().Value; if (Pk != null && Pk > 0) { item.Update(); } else { item.Create(); } return(Json(item, JsonRequestBehavior.AllowGet)); }
protected void Put <T>(int id, IOrmModel model) where T : IOrmModel, new() { int?Pk = model.PrimaryKey().Value; model.Update(); }