예제 #1
0
        public DeviceContext(IOptions <Settings> settings)
        {
            var client = new MongoClient(settings.Value.ConnectionString);

            if (client != null)
            {
                _database = client.GetDatabase(settings.Value.Database);
            }
            Gpses = new GpsRepository(settings);
            ConnectionAttributes = new ConnectionAttributesRepository(settings);
            HardwareStatuses     = new HardwareStatusesRepository(settings);
            Resets       = new ResetsRepository(settings);
            UnparsedData = new UnparsedDataRepository(settings);
            Devices      = new DeviceRepository(settings);
        }
예제 #2
0
 public GpsService(GpsRepository repository)
 {
     _repository = repository;
 }