public async Task <IActionResult> PostAsync([FromBody] Tickets newTicket) { var ticket = Mapper.MapTickets(newTicket); _repo.AddTicketAsync(ticket); await _repo.SaveAsync(); if (await _repo.GetLatestTicketAsync() is Domain.Models.Tickets newEntity) { return(Ok(newEntity)); } else //if (await _repo.GetLatestTicketAsync() is null) { return(StatusCode(500, "Ticket is improperly formatted")); } }