Ejemplo n.º 1
0
        public async Task <IActionResult> PutAsync(int id, [FromBody] SaveEstateResource resource)
        {
            var estate = _mapper.Map <SaveEstateResource, Estate>(resource);
            var result = await _estateService.UpdateAsync(id, estate);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var estateResource = _mapper.Map <Estate, EstateResource>(result.Resource);

            return(Ok(estateResource));
        }