public IActionResult Post([FromHeader] string eventId, [FromBody] SpeakerRequest speaker) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _speakerService.Create(speaker, eventId); return(Ok()); }
public ActionResult Create(SpeakersViewModel speakers) { if (ModelState.IsValid) { Speakers speakerToAdd = new Speakers(); speakerToAdd.InjectFrom(speakers); speakerService.Create(speakerToAdd); return(RedirectToAction(nameof(Index))); } else { return(View(speakers)); } }