private Commentary CommentOnExistingMatch(int idMatch, Commentary aComment) { CommentEntity comment = commentConverter.ToEntity(aComment); EncounterEntity commented = context.Encounters.Include(m => m.Commentaries).First(m => m.Id == idMatch); commented.Commentaries.Add(comment); context.Attach(comment).State = EntityState.Added; context.SaveChanges(); return(commentConverter.ToComment(comment)); }
public void EntityToCommentTextTest() { Commentary converted = testMapper.ToComment(commentEntity); Assert.AreEqual(converted.Text, commentEntity.Text); }