예제 #1
0
        public async Task <ActionResult <DisplayGuestResource> > DeleteGuest(int id)
        {
            var result = await _guestService.DeleteAsync(id);

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

            var GuestResource = _mapper.Map <Guest, DisplayGuestResource>(result.Guest);

            return(GuestResource);
        }
예제 #2
0
        public async Task <IActionResult> Delete([FromRoute] long id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var result = await _GuestService.DeleteAsync(id);

            if (!result.Succeeded)
            {
                return(BadRequest(result.Errors));
            }

            return(Ok(result));
        }