Пример #1
0
        private string HandleNewIssueType(IssueType newIssueType, SupportTicket supportTicket)
        {
            if (newIssueType != null && newIssueType.IsTransient())
            {
                // Validation should already have been enforced
                if (!DataAnnotationsValidator.TryValidate(newIssueType))
                {
                    throw new InvalidOperationException("newIssueType is in an invalid state");
                }

                _issueTypeRepository.SaveOrUpdate(newIssueType);
                supportTicket.IssueType = newIssueType;

                return(" The issue type '" + newIssueType.Name + "' has been added.");
            }

            return(null);
        }