示例#1
0
 public void Update(Recurso myObject)
 {
     try
     {
         _repository.Update(myObject);
         _unitOfWork.Commit();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public bool Editar(Entities.Models.Recurso.RecursoModel model)
        {
            if (ValidaCamposObrigatorios(model) && ValidaSeRegistroJaCadastrado(model, false))
            {
                var obj = new Recurso(model.Nome, model.Id.Value);

                _recursoRepository.Update(obj);

                return(true);
            }
            else
            {
                return(false);
            }
        }