public async Task <IActionResult> Post([FromBody] ContestantCompetitionForCreation contestandCompetition)
        {
            if (!ModelState.IsValid || contestandCompetition == null)
            {
                return(BadRequest());
            }
            contestandCompetition.Competition =
                competitionService.GetCompetitionByIdAsync(contestandCompetition.CompetitionId).Result;
            contestandCompetition.Contestant =
                contestantService.GetContestantsByIdAsync(contestandCompetition.ContestantId).Result;

            var contestandCompetitionToAdd = mapper.Map <ContestantCompetition>(contestandCompetition);

            await contestantCompetitionServis.AddConstestandCompetitionAsync(contestandCompetitionToAdd);

            if (!await contestantCompetitionServis.SaveChanges())
            {
                return(StatusCode(500, "Fault while saving..."));
            }

            var contestandCompetitionForDisplay =
                mapper.Map <ContestantCompetitionForDisplay>(contestandCompetitionToAdd);

            return(Ok(contestandCompetitionForDisplay));
        }
        public async Task <IActionResult> Delete(Guid id)
        {
            var contestant = await contestantService.GetContestantsByIdAsync(id);

            if (contestant == null)
            {
                return(BadRequest());
            }
            await contestantService.DeleteContestantAsync(contestant);

            if (!await contestantService.SaveChanges())
            {
                return(StatusCode(500, "Fault while saving..."));
            }
            return(NoContent());
        }