Пример #1
0
        public async Task <ActionResult <CapturedTicketCredential> > CreateTicketCredential([FromBody] CapturedTicketCredential credential)
        {
            try
            {
                CapturedTicketCredential addedCredential = await _context.CreateTicketCredential(credential);

                return(CreatedAtRoute(nameof(GetHashCredential), new { id = addedCredential.Id }, addedCredential));
            }
            catch (ControllerNotFoundException e)
            {
                return(NotFound(e.Message));
            }
            catch (ControllerBadRequestException e)
            {
                return(BadRequest(e.Message));
            }
            catch (ControllerUnauthorizedException)
            {
                return(new UnauthorizedResult());
            }
        }
Пример #2
0
        public async Task <IActionResult> CreateTicketCredential(CapturedTicketCredential credential)
        {
            CapturedCredential createdCredential = await _context.CreateTicketCredential(credential);

            return(RedirectToAction("Index", "Data"));
        }