예제 #1
0
        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));
        }
예제 #2
0
        public void EntityToCommentTextTest()
        {
            Commentary converted = testMapper.ToComment(commentEntity);

            Assert.AreEqual(converted.Text, commentEntity.Text);
        }