/// <summary> /// LINQ更新方法 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="dc"></param> /// <param name="fun"></param> /// <param name="tentity"></param> /// <param name="action"></param> public static bool Update(Expression <Func <Camera, bool> > fun, Action <Camera> action) { bool rbool = true; try { LinQBaseDao.Update <Camera>(new DCCarManagementDataContext(), fun, action); } catch { rbool = false; } return(rbool); }
/// <summary> /// LINQ更新方法 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="dc"></param> /// <param name="fun"></param> /// <param name="tentity"></param> /// <param name="action"></param> public static bool Update(Expression <Func <UserInfo, bool> > fun, Action <UserInfo> action) { bool rbool = true; using (DCCarManagementDataContext db = new DCCarManagementDataContext()) { try { LinQBaseDao.Update <UserInfo>(db, fun, action); } catch { rbool = false; } finally { db.Connection.Close(); } return(rbool); } }