Exemplo n.º 1
0
        public async Task <ActionResult <ApiResponse> > BuyNewAppartamentAsync(User user, int appartamentId)
        {
            ResultWithMessage result = await _buildingService.BuyAppartamentsAsync(user, appartamentId);

            if (result.IsSuccess)
            {
                return(new OkObjectResult(new ApiResponse(200, result.Message)));
            }

            return(new BadRequestObjectResult(new ApiResponse(400, result.Message)));
        }