コード例 #1
0
        public async Task <IActionResult> AddPollingStationAsync([FromBody] PollingStationUploadModel pollingStation)
        {
            var result = await _mediator.Send(new AddPollingStation(pollingStation));

            if (!result.isSuccess)
            {
                return(Problem(result.errorMessage));
            }

            return(Ok(result.pollingStationId));
        }
コード例 #2
0
        public async Task <IActionResult> UpdatePollingStationAsync([FromRoute] int id, [FromBody] PollingStationUploadModel pollingStation)
        {
            var result = await _mediator.Send(new UpdatePollingStation(id, pollingStation));

            if (!result.isSuccess)
            {
                return(Problem(result.errorMessage));
            }

            return(Ok());
        }