/// <summary> /// Handler, deletes a record. /// </summary> public IActionResult OnGetRemove(int id) { RoleMaster RoleMaster = RoleMaster.SelectByPrimaryKey(id); RoleMaster.Delete(id); return(new JsonResult(true)); }
/// <summary> /// 删除 /// </summary> /// <returns>是否成功</returns> public override void Delete() { if (!m_Loaded) { throw new AppException("尚未初始化"); } bool result = (RoleMaster.Delete(RoleMasterId) == 1); //更新缓存 if (result && CachedEntityCommander.IsTypeRegistered(typeof(RoleMasterInfo))) { ResetCache(); } if (!result) { throw new AppException("删除失败,数据可能被删除"); } }
/// <summary> /// Shows how to Delete an existing record by Primary Key /// </summary> private void Delete() { // delete a record by primary key RoleMaster.Delete(7); }