コード例 #1
0
ファイル: ArticleRepository.cs プロジェクト: kevmcivor/kpmg
        public async Task <Comment> AddComment(Comment comment)
        {
            _context.Attach(comment.Author);
            _context.Attach(comment.Article);
            _context.Add(comment);

            await _context.SaveChangesAsync();

            return(comment);
        }