예제 #1
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity">对象</param>
        /// <param name="scorpList">范围更新的列表</param>
        /// <param name="lstValue">set实体</param>
        /// <param name="optimisticConcurrency">并发控制</param>
        /// <returns></returns>
        public virtual object Update(T entity, ScopeList scorpList, ValueSetList lstValue, bool optimisticConcurrency)
        {
            DataAccessModel <T> entityDao = new DataAccessModel <T>();

            object ret = Exists(entity);

            if (ret != null)
            {
                return(ret);
            }

            _affectedRows = entityDao.Update(entity, scorpList, lstValue, optimisticConcurrency);


            return(ret);
        }
예제 #2
0
        /// <summary>
        /// 批量更新
        /// </summary>
        /// <param name="lst">要更新的实体集合</param>
        /// <param name="scorpList"></param>
        /// <returns></returns>
        public virtual object Update(List <T> lst, ScopeList scorpList)
        {
            DataAccessModel <T> entityDao = new DataAccessModel <T>();

            object ret = null;

            foreach (T entity in lst)
            {
                ret = Exists(entity);
                if (ret != null)
                {
                    continue;
                }
                _affectedRows += entityDao.Update(entity, scorpList);
            }

            return(ret);
        }