コード例 #1
0
        public async Task <EventLocation> GetEventLocation()
        {
            if (_cache.HasValue)
            {
                return(_cache.GetValue());
            }
            var mongoCollection = _database.GetCollection <EventLocationDbo>(StatusDbName);
            var location        = await mongoCollection.FindSync(e => e.Id == nameof(EventLocation)).SingleOrDefaultAsync();

            return(location == null?EventLocation.Default() : new EventLocation(location.Services.Select(s =>
                                                                                                         MicrowaveServiceNode.Create(s.ServiceEndPoint, s.SubscribedEvents, s.ReadModels)), location
                                                                                .UnresolvedEventSubscriptions, location.UnresolvedReadModeSubscriptions));
        }
コード例 #2
0
 public Task <EventLocation> GetEventLocation()
 {
     return(Task.FromResult(_location ?? EventLocation.Default()));
 }