Example #1
0
        public T Get <T, TId>(string bucketId, string id, int version = int.MaxValue)
            where T : class, IEventSource <TId>
        {
            bool isMaxVersion = version == int.MaxValue;

            var eventSource = this.GetCachedEventSource <T, TId>(bucketId, id, version, isMaxVersion);

            if (eventSource == null)
            {
                Logger.Debug("EventSource not found in memory with id {0} and BucketId {1}. So read from event source.", id, bucketId);
                eventSource = _eventSourceMapper.Get <T, TId>(bucketId, id, version);
            }

            this.RegisterInternal(eventSource, isMaxVersion);

            return(eventSource);
        }
Example #2
0
 protected override void Event()
 {
     _returnedEventSource = _eventSourceMapper.Get <IEventSource>(Guid.NewGuid());
 }
Example #3
0
 protected override void Event()
 {
     _returnedEventSource = _eventSourceMapper.Get <IEventSource>(_id);
 }
Example #4
0
 protected override void Event()
 {
     _returnedEventSource = _eventSourceMapper.Get <IEventSource <Guid>, Guid>(BucketSupport.DefaultBucketId, Guid.NewGuid().ToString(), int.MaxValue);
 }
Example #5
0
        public T Get <T>(Guid id) where T : class, IEventSource
        {
            var eventSource = _eventSources.OfType <T>().SingleOrDefault(s => s.Id == id) ?? _eventSourceMapper.Get <T>(id);

            Register(eventSource);

            return(eventSource);
        }