public bool Save(QuestionType element) { if (element.Id == 0) { element = _questionTypeRepo.Add(element); } else { element = _questionTypeRepo.Update(element); } return(true); }
public async Task <MessageModel <int> > Post([FromBody] QuestionType QuestionType) { if (QuestionType == null) { return(new MessageModel <int>() { msg = "参数异常", response = 0 }); } var blogId = await _questionTypeRepository.Add(QuestionType); return(new MessageModel <int>() { msg = "添加成功", success = true, response = blogId }); }