コード例 #1
0
        public async Task <ActionResult <Dialog> > CreateDialog(Dialog dialog)
        {
            _context.Dialogs.Add(dialog);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(CreateDialog), new { id = dialog.Id }, dialog));
        }
コード例 #2
0
        public async Task <ActionResult <Questionnaire> > CreateQuestionnaire(Questionnaire questionnaire)
        {
            _context.Questionnaires.Add(questionnaire);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(CreateQuestionnaire), new { id = questionnaire.Id }, questionnaire));
        }
コード例 #3
0
        public async Task <ActionResult <Report> > PostReport(Report report)
        {
            _context.Reports.Add(report);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetReport), new { id = report.Id }, report));
        }
コード例 #4
0
        public async Task <ActionResult <Dialog> > CreateMessage(Message message)
        {
            _context.Messages.Add(message);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(CreateMessage), new { id = message.Id }, message));
        }