示例#1
0
        public void AddQuestion(QuestionDto question, string operatedBy)
        {
            var entity = QuestionFactory.CreateInstance(question.Subject, question.Remark, operatedBy);

            _questionRepository.Add(entity);
            var tags = question.Tags;

            foreach (var item in tags)
            {
                var tag = QuestionTagFactory.CreateInstance(item.Name, entity.Id);
                _questionTagRepository.Add(tag);
            }
            _dbUnitOfWork.Commit();
        }