Ejemplo n.º 1
0
        public IActionResult Post([FromHeader] string eventId, [FromBody] SpeakerRequest speaker)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _speakerService.Create(speaker, eventId);

            return(Ok());
        }
Ejemplo n.º 2
0
        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));
            }
        }