public async Task <bool> Update(BLL.Contract.Entities.Asset asset, CancellationToken cancellationToken = default) { var updateResult = await _context .Assets .ReplaceOneAsync(filter : item => item.Id == asset.Id, replacement : asset, cancellationToken : cancellationToken); return(updateResult.IsAcknowledged && updateResult.ModifiedCount > 0); }
public async Task Create(BLL.Contract.Entities.Asset asset, CancellationToken cancellationToken = default) { await _context.Assets.InsertOneAsync(asset, new InsertOneOptions(), cancellationToken); }