当前位置: 首页>>代码示例>>C#>>正文


C# Question.Save方法代码示例

本文整理汇总了C#中Question.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Question.Save方法的具体用法?C# Question.Save怎么用?C# Question.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Question的用法示例。


在下文中一共展示了Question.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveQuestion

 public static int SaveQuestion(Question question)
 {
     question.Title = question.Title.Replace("\n", "<br/>");
     question.Help = question.Help.Replace("\n", "<br/>");
     question.Save();
     return question.Id;
 }
开发者ID:Hookem22,项目名称:BPlan,代码行数:7,代码来源:Default.aspx.cs

示例2: CreateQuestionLoadDontRetrieveLazyAndSave

        public void CreateQuestionLoadDontRetrieveLazyAndSave()
        {
            SetUp();
            Question q = new Question();
            q.URL = "mumbo-jumbo";
            q.Body = "mumbo jumbo";
            Answer a1 = new Answer();
            q.Answers.Add(a1);
            q.Save();

            // We want to verify that a non-touched LazyList will not be deleted ...!
            Question q2 = Question.SelectByID(q.ID);
            q2.Save();
            q2 = Question.SelectByID(q.ID);

            Assert.IsNotNull(q2.Answers);
            Assert.AreEqual(1, q2.Answers.Count);
        }
开发者ID:greaterwinner,项目名称:ra-brix,代码行数:18,代码来源:QuestionTests.cs

示例3: InsertInfo

        public static void InsertInfo()
        {
            User user = new User();
            user.Username = "mario.chavez";
            user.Email = "[email protected]";
            user.SaveAndFlush();

            Question q1 = new Question();
            q1.Message = "Pregunta 1";
            q1.User = user;

            Question q2 = new Question();
            q2.Message = "Pregunta 2";
            q2.User = user;

            q1.Save();
            q2.Save();
            user.SaveAndFlush();
        }
开发者ID:mariochavez,项目名称:Cesun-AppDistribuidas,代码行数:19,代码来源:Main.cs

示例4: RequestSavingOfStackedQuestion

        protected void RequestSavingOfStackedQuestion(object sender, ActiveEventArgs e)
        {
            // Saving new question...
            Question q = new Question();
            q.Body = e.Params["Body"].Get<string>();
            q.Header = e.Params["Header"].Get<string>();
            q.Save();

            // Updating User's score with points for question
            User u = User.SelectFirst(Criteria.Eq("Username", Users.LoggedInUserName));
            u.Score += Settings.Instance.Get<int>("UserScoreForNewQuestion", 6);
            u.Save();
            ShowQuestionsLandingPage();
        }
开发者ID:greaterwinner,项目名称:ra-brix,代码行数:14,代码来源:StackedController.cs


注:本文中的Question.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。