public ActionResult Add(FaqModel model) { if (ModelState.IsValid) { Faq faq = new Faq(); faq.UpdateModel(model); UpdateResult result = _faqService.Add(faq); if (result.State == 1) { ViewBag.Completed = true; } else { ViewBag.Completed = false; } } return(View(model)); }
public ActionResult <ItemResponse <int> > Add(FaqAddRequest model) { ObjectResult result = null; try { int userId = _authService.GetCurrentUserId(); int id = _service.Add(model, userId); ItemResponse <int> response = new ItemResponse <int> { Item = id }; result = Created201(response); } catch (Exception exception) { base.Logger.LogError(exception.ToString()); ErrorResponse response = new ErrorResponse(exception.Message); result = StatusCode(500, response); } return(result); }
public RedirectToRouteResult Add_POST(Faq item) { _faqService.Add(item); return(RedirectToAction("Edit", "Webpage", new { id = item.ShowFaqs.Id })); }
public IActionResult Post([FromBody] Faq body) { var entity = _manager.Add(body); return(ResponseJson(entity)); }