public async Task <IActionResult> Create([Bind("Id,Petition,EventType,Place,EventDate,NAssistants,Details,Name,phone,Email")] Event @event) { if (ModelState.IsValid) { _context.Add(@event); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Done))); } return(View(@event)); }
public IActionResult Contact(Quotes model) { //ViewData["Message"] = "Your contact page."; if (ModelState.IsValid) { _context.Add(model); _context.SaveChanges(); var quotes = _context.Quotes.ToList(); return(View("Index", quotes)); } return(View(model)); }
public IActionResult Create([FromBody] Quotes quote) { if (quote == null) { return(BadRequest()); } _context.Add(quote); _context.SaveChanges(); return(CreatedAtRoute("GetQuotes", new { id = quote.Id }, quote)); }