public async Task <IActionResult> InsertOnGrid(string values)
        {
            var question = new Test_Question();

            JsonConvert.PopulateObject(values, question);
            if (!TryValidateModel(question))
            {
                return(BadRequest(ModelState.GetFullErrorMessage()));
            }
            var model = await _questionService.AddAsync(question);

            return(Ok(model));
        }
Beispiel #2
0
 public Task <Test_Question> DeleteAsync(Test_Question entity)
 {
     return(_questionRepository.DeleteAsync(entity));
 }
        public async Task <IActionResult> DeleteAsync([FromBody] Test_Question question)
        {
            var model = await _questionService.DeleteAsync(question);

            return(Ok(model));
        }
Beispiel #4
0
 public Task <Test_Question> AddAsync(Test_Question entity)
 {
     entity.QuestionId = Guid.NewGuid();
     return(_questionRepository.AddAsync(entity));
 }