コード例 #1
0
        public async Task <long> UpdateComment(CommentDBEntities comment)
        {
            _context.Entry(comment).State = EntityState.Modified;

            var result = await _context.SaveChangesAsync();

            return(await Task.FromResult(result));
        }
コード例 #2
0
        public async Task <long> SaveComment(CommentDBEntities comment)
        {
            await this.Entities.AddAsync(comment);

            return(await _context.SaveChangesAsync());
        }