Exemplo n.º 1
0
        public async Task <IActionResult> AddNewUser([FromBody] PersonRequest person)
        {
            var newPerson = this.mappersFacade.PersonMapper.MapPerson(person);

            await this.unitOfWork.PersonRepository.Add(newPerson);

            await this.unitOfWork.Commit();

            return(Ok(this.mappersFacade.PersonMapper.MapPersonToViewModel(newPerson)));
        }
Exemplo n.º 2
0
        public HttpResponseMessage SavePersonCreated(PersonRequest personRequest)
        {
            var result = new PersonResponse
            {
                Id        = 123,
                Title     = Title.Dr,
                FirstName = "John",
                LastName  = "Doe",
                Age       = 27,
                Income    = null
            };

            return(Request.CreateResponse(HttpStatusCode.Created, result));
        }
 public IHttpActionResult GetPerson(PersonRequest personRequest)
 {
     var personResponse = new PersonResponse { Id = 1, Title = Title.Mr, FirstName = "Dave", Age = 32 };
     return Ok(personResponse);
 }
Exemplo n.º 4
0
        public HttpResponseMessage PostenericPerson(PersonRequest personRequest)
        {
            string result = "Created";

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }