protected MongoRepository() { _mongoContext = new TContext(); //Entity Class'larının üzerinde ki BsonDiscriminator var className = typeof(TEntity).CustomAttributes.Select(p => p.ConstructorArguments[0].Value).FirstOrDefault().ToString(); _dbCollection = _mongoContext.GetCollection <TEntity>(className); }
protected BaseRepository(IMongoBookDBContext context) { _mongoContext = context; _dbCollection = _mongoContext.GetCollection <TEntity>(typeof(TEntity).Name); }
public BookController(IMongoBookDBContext context) { _context = context; _dbCollection = _context.GetCollection <Book>(typeof(Book).Name); }
public StudentRepository(IMongoBookDBContext context) : base(context) { }
public UserService(ILogger <UserService> logger, IMongoBookDBContext context) { _logger = logger; _mongoContext = context; _dbCollection = _mongoContext.GetCollection <Users>("Users"); }
public BookRepository(IMongoBookDBContext context) : base(context) { }