//修改关注基金 private void UpdateFollowFunds(IEnumerable <FollowFundModel> followFundModels, SqlTransaction transaction) { var followFundEntities = _con.GetEntities <FollowFundEntity>().Where(p => p.Valid == 1 && p.UserId == _currentUser.Id).ToQuery <FollowFundEntity>(); _con.DeleteRecords(followFundEntities, transaction); if (followFundModels.Any()) { var followFunds = followFundModels.Select(p => new FollowFundEntity { UserId = _currentUser.Id, FundCode = p.FundCode }); ///添加关注基金 _con.AddRecords(followFunds, transaction); } }