public async Task <Match> AddComment(MatchComment comment) { using (var dbContext = new TtcDbContext()) { var entity = Mapper.Map <MatchCommentEntity>(comment); entity.PostedOn = TtcDbContext.GetCurrentBelgianDateTime(); dbContext.MatchComments.Add(entity); await dbContext.SaveChangesAsync(); } var newMatch = await GetMatch(comment.MatchId); return(newMatch); }
public async Task <Match> Comment([FromBody] MatchComment comment) { var result = await _service.AddComment(comment); return(result); }