public ValidationResult Update(Domain.Entities.CourseConfiguration entity)
        {
            if (entity == null)
            {
                var result = new ValidationResult();
                result.AddError("Nenhuma configuraçao de curso informada para atualização.");
                return(result);
            }

            if (!entity.IsValid())
            {
                return(entity);
            }

            if (entity.IsCurrentConfiguration)
            {
                try
                {
                    DisableCurrentConfiguration(entity);
                }
                catch (Exception ex)
                {
                    entity.AddError(ex.Message);
                    return(entity);
                }
            }

            entity.UpdatedDate = DateTime.Now;

            _courseDocumentRepository.RemoveByCourseConfiguration(entity.Id.Value);

            _courseConfigurationRepository.Update(entity);

            return(new ValidationResult());
        }