コード例 #1
0
ファイル: FaqsController.cs プロジェクト: baodev2110/Vy.Faq
        public async Task <IActionResult> PutFaq(int id, Models.Faq faq)
        {
            if (id != faq.Id)
            {
                return(BadRequest());
            }

            _vyContext.Entry(faq).State = EntityState.Modified;

            try
            {
                await _vyContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FaqExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <ActionResult <QuestionForm> > PostContact(QuestionForm questionForm)
        {
            _vyContext.QuestionForms.Add(questionForm);
            await _vyContext.SaveChangesAsync();

            return(Ok());
        }