public ProductRepository(WebApiWithMongoContext context)
     : base(context)
 {
     _collection = _context.database.GetCollection <Product>(_collectionName);
     if (_collection == null)
     {
         _context.database.CreateCollection(_collectionName);
         _collection = _context.database.GetCollection <Product>(_collectionName);
     }
 }
Exemple #2
0
 public Repository(WebApiWithMongoContext context)
 {
     _context = context;
 }