public IActionResult CreateConference(ConferenceViewModel conferenceViewModel)
        {
            var success = conferenceRepository.CreateConference(conferenceViewModel);

            if (success)
            {
                return(Created("pending", null));
            }
            return(BadRequest(new { Error = "User exists" }));
        }
Пример #2
0
        public virtual IActionResult AddConference([FromBody] ConferenceCreateDto conference)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var newConference = _conferenceRepository.CreateConference(conference);

            _conferenceRepository.Save();

            var location = "/conferences/" + newConference.Id;

            return(Created(location, newConference));
        }