public async Task CreateQuizAsync(QuizViewModel quiz) { if (quiz == null) { throw new ArgumentNullException(nameof(quiz)); } var quizEntity = new QuizEntity(Quizzes, quiz.ID) { Json = JsonSerializer.Serialize(quiz) }; var upsertOperation = TableOperation.Insert(quizEntity); await _quizzesTable.ExecuteAsync(upsertOperation); }
public void UpsertQuiz(QuizViewModel quiz) { if (quiz == null) { throw new ArgumentNullException(nameof(quiz)); } var quizEntity = new QuizEntity(Quizzes, quiz.ID) { Json = JsonSerializer.Serialize(quiz) }; var upsertOperation = TableOperation.InsertOrReplace(quizEntity); _quizzesTable.Execute(upsertOperation); }