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); } }
public Repository(WebApiWithMongoContext context) { _context = context; }