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); }
protected override void Event() { _returnedEventSource = _eventSourceMapper.Get <IEventSource>(Guid.NewGuid()); }
protected override void Event() { _returnedEventSource = _eventSourceMapper.Get <IEventSource>(_id); }
protected override void Event() { _returnedEventSource = _eventSourceMapper.Get <IEventSource <Guid>, Guid>(BucketSupport.DefaultBucketId, Guid.NewGuid().ToString(), int.MaxValue); }
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); }