Пример #1
0
        public IHttpActionResult Post([FromBody] PeopleVM people)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            try
            {
                _peopleService.CreatePeopleDocumentInMongo(new PeopleControllerHelper().MapPeopleVmToDto(people));


                _peopleService.CreatePeopleDocumentInElastic(new PeopleControllerHelper().MapPeopleVmToDto(people));
            }

            catch (Exception ex)
            {
                return(BadRequest());
            }

            //var message = Request.CreateResponse(HttpStatusCode.Created, people);

            return(Ok());
        }