/// <summary> /// 删除数据 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="entity"></param> /// <returns></returns> public int Delete <T>(T entity) where T : class { using (var db = new BFdbContext()) { return(db.Delete <T>(entity)); } }
/// <summary> /// 删除角色 /// </summary> /// <param name="id"></param> /// <returns></returns> public string DelRole(string id) { try { using (BFdbContext db = new BFdbContext()) { TBROLE role = db.TBROLE.Find(id); role.ID = id; return(db.Delete <TBROLE>(role).ToString()); } } catch (Exception ex) { log.Error(ex); throw GetFault(ex); } }
public string DelRule(string ruleid) { try { using (BFdbContext db = new BFdbContext()) { CMNRULE ent = new CMNRULE(); ent.ID = ruleid; return(db.Delete <CMNRULE>(ent).ToString()); } } catch (Exception ex) { log.Error(ex); throw GetFault(ex); } }