Пример #1
0
        public async Task <bool> Update(Knowledge knowledge)
        {
            ReplaceOneResult updateResult =
                await _context
                .KnowledgeBase
                .ReplaceOneAsync(
                    filter : g => g.id == knowledge.id,
                    replacement : knowledge);

            return(updateResult.IsAcknowledged &&
                   updateResult.ModifiedCount > 0);
        }
Пример #2
0
 public async Task Create(Knowledge knowledge)
 {
     await _context.KnowledgeBase.InsertOneAsync(knowledge);
 }