Ejemplo n.º 1
0
        public GetConfigEnvironmentViewModel Update(UpdateConfigEnvironmentViewModel model, int userID)
        {
            if (_dbContext.ConfigEnvironment.Any(ce => ce.Name == model.Name && ce.ID != model.ID && !ce.IsDeleted))
            {
                throw new AException(ErrorCode.NameExist);
            }

            var entity = new MapperWrapper <UpdateConfigEnvironmentViewModel, ConfigEnvironment>().GetEntity(model);

            _dbContext.Update <ConfigEnvironment, int>(entity, userID);

            return(new MapperWrapper <GetConfigEnvironmentViewModel, ConfigEnvironment>().GetModel(entity));
        }
Ejemplo n.º 2
0
 public GetConfigEnvironmentViewModel Put(UpdateConfigEnvironmentViewModel model)
 {
     return(_biz.Update(model, User.GetUserID()));
 }