示例#1
0
        public ServiceService(IOptions <DatabaseSettings> settings)
        {
            _settings = settings?.Value ?? throw new ArgumentNullException(nameof(settings));

            _context           = new BarbershopContext(_settings);
            _serviceRepository = new ServiceRepository(_context);
        }
示例#2
0
 public BaseRepository(IBarbershopContext context, String collectionName)
 {
     _context    = context;
     _collection = String.IsNullOrEmpty(collectionName) ? throw new ArgumentNullException(nameof(collectionName)) : context.Database.GetCollection <TDocument>(collectionName);
 }
 public ServiceRepository(IBarbershopContext context)
     : base(context, "Services")
 {
 }
示例#4
0
 public ServiceService(String connectionString, String database)
 {
     _context = new BarbershopContext(connectionString, database);
 }