Ejemplo n.º 1
0
 public void AskQuestion(int gameId, int playerId, string questionText)
 {
     var question = new Question { QuestionText = questionText, Status = QuestionStatus.UnAnswered };
     var game = _context.Games.Single(g => g.Id == gameId);
     game.Questions.Add(question);
     _context.SaveChanges();
     _notificationService.QuestionAsked(question.Id);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Questions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToQuestions(Question question)
 {
     base.AddObject("Questions", question);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new Question object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="gameID">Initial value of the GameID property.</param>
 /// <param name="createdOn">Initial value of the CreatedOn property.</param>
 /// <param name="updatedOn">Initial value of the UpdatedOn property.</param>
 public static Question CreateQuestion(global::System.Int32 id, global::System.Int32 gameID, global::System.DateTime createdOn, global::System.DateTime updatedOn)
 {
     Question question = new Question();
     question.Id = id;
     question.GameID = gameID;
     question.CreatedOn = createdOn;
     question.UpdatedOn = updatedOn;
     return question;
 }