public void Insert(Order order)
        {
            try
            {
                var collection = MongoDBConnectionFactory <Order> .GetCollection();

                collection.InsertOne(order);
            }catch (Exception ex)
            {
                _logger.LogError($"Erro ao tentar inserir um novo pedido. OrderId: {order.OrderId}", ex);
                throw;
            }
        }
示例#2
0
 public MongoDBSearchService()
 {
     mongoContext = MongoDBConnectionFactory.getInstance()
                    .MongoDBFactory;
 }