public ItemAvaliacao Atualizar(ItemAvaliacao obj) { if (!obj.IsValid()) { return(obj); } obj.ValidationResult = new ItemAvaliacaoValidation().Validate(obj); if (!obj.ValidationResult.IsValid) { return(obj); } obj.ValidationResult.Message = Mensagens.MS_004; return(_classRepository.Atualizar(obj)); }
public ItemAvaliacao Adicionar(ItemAvaliacao obj) { try { if (!obj.IsValid()) { return(obj); } obj.ValidationResult = new ItemAvaliacaoValidation().Validate(obj); if (!obj.ValidationResult.IsValid) { return(obj); } obj.ValidationResult.Message = Mensagens.MS_003; return(_classRepository.AdicionarSave(obj)); } catch (Exception ex) { obj.ValidationResult.Add(new DomainValidation.Validation.ValidationError(ex.Message)); return(obj); } }