private void Load() { _fiberCableInfos = new Dictionary <Guid, FiberCableInfo>(); _pointOfInterestIndex = new PointOfInterestIndex(_routeNetworkQueryService); using (var session = _documentStore.LightweightSession()) { // Fetch everything into memory for fast access var fiberCables = session.Query <FiberCableInfo>(); foreach (var fiberCable in fiberCables) { UpdateFiberCableInfo(fiberCable); } } }
public FiberNetworkQueryService(IDocumentStore documentStore, IRouteNetworkState routeNetworkQueryService) { this._documentStore = documentStore; this._routeNetworkQueryService = routeNetworkQueryService; this._pointOfInterestIndex = new PointOfInterestIndex(routeNetworkQueryService); var config = new MapperConfiguration(cfg => { cfg.CreateMap <FiberCableInfo, FiberCableInfo>(); }); _mapper = config.CreateMapper(); Load(); }