-
Couldn't load subscription status.
- Fork 1.1k
[Query] Add non-generic ReadJournalFor API
#7679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Query] Add non-generic ReadJournalFor API
#7679
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-review
| { | ||
| public sealed class PersistenceQuery : IExtension | ||
| { | ||
| private static readonly Type ReadJournalType = typeof(IReadJournal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type cache of IReadJournal
| _system = system; | ||
| } | ||
|
|
||
| public TJournal ReadJournalFor<TJournal>(string readJournalPluginId) where TJournal : IReadJournal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old API is left intact
| if(!ReadJournalType.IsAssignableFrom(readJournalType)) | ||
| throw new ArgumentException("Must implement IReadJournal interface", nameof(readJournalType)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added type checking code to make sure that readJournalType implements IReadJournal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #7678
Changes
Add non-generic
ReadJournalForAPIChecklist
For significant changes, please ensure that the following have been completed (delete if not relevant):