public async Task <Commentary> AddCommentaryAsync(int promotionId, Commentary commentary) { if (commentary.promotionId != null && promotionId != commentary.promotionId) { throw new BadRequestOperationException("URL promotion id and Commentary.PromotionId should be equal"); } commentary.promotionId = promotionId; var promotionEntity = await validatPromotionId(promotionId); var commentaryEntity = mapper.Map <CommentaryEntity>(commentary); premierLeagueRepository.CreateCommentary(commentaryEntity); if (await premierLeagueRepository.SaveChangesAsync()) { return(mapper.Map <Commentary>(commentaryEntity)); } throw new Exception("There were an error with the DB"); }