コード例 #1
0
        public Question CreateQuestion(string categoryIDString, string source, string userName, MetaData meta)
        {
            long categoryID = Convert.ToInt64(categoryIDString);
            var category = CategoryRepository.Find(categoryID);

            Question question = new Question();
            question.QuestionID = IDProvider.GetNewId("QuestionID");
            question.CreatedTime = TimeProvider.Now;
            question.CreatedUserName = userName;
            question.Category = category;
            question.Source = source;

            meta.AlterWiki("Answer", userName, new KEYID("QuestionAnswer", question.QuestionID));

            question.Meta = meta;

            return question;
        }