コード例 #1
0
        public ProcessResult Edit(List <T> entities)
        {
            foreach (var entity in entities)
            {
                var result = Edit(entity);
                if (!result.State)
                {
                    return(new FailDeleteResult());
                }
            }

            var returnModel = new SuccessUpdateResult();

            return(returnModel);
        }
コード例 #2
0
        public ProcessResult Edit(T entity)
        {
            try
            {
                _dbSet.Attach(entity);
                _dbContext.Entry(entity).State = EntityState.Modified;

                var returnModel = new SuccessUpdateResult();
                return(returnModel);
            }
            catch (Exception e)
            {
                Project2353DefaultDbContext.SaveLog(e.Message);
                return(new FailUpdateResult());
            }
        }