/// <summary> /// 修改 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Modify(CommonUserRole entity) { using (var context = new DbContext()) { context.CommonUserRoleContext.Update(entity); return(context.SaveChanges() > 0); } }
/// <summary> /// 新增 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Add(CommonUserRole entity) { using (var context = new DbContext()) { context.CommonUserRoleContext.Add(entity); return(context.SaveChanges() > 0); } }