Skip to content

Commit 78c8728

Browse files
committed
Reintroduced Load() overload as [Obsolete]
The `Load(uniqueKey, isRecursive)` overload was updated to include the `referenceTopic` parameter. By reintroducing the original overload, we provide instructions to callers of the original method signature. In practice, we don't expect this to be a common scenario, as it is generally expected that loads will be recursive. Unfortunately, an `[Obsolete[]` member of an interface still needs to be implemented on each implementation of that interface. As such, we won't want to persist these for long after the migration to OnTopic 5.0.0. That said, fortunately, we expect all implementations of `ITopicRepository` to implement `ObservableTopicRepository` as a base class and, therefore, can implement these in that one location in order to cover all derived types (e.g., `SqlTopicRepository`, `CachedTopicRepository`, &c.)
1 parent bad250b commit 78c8728

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

OnTopic/Repositories/ITopicRepository.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public interface ITopicRepository {
106106
/// <returns>A topic object.</returns>
107107
Topic? Load(string? uniqueKey = null, Topic? referenceTopic = null, bool isRecursive = true);
108108

109+
/// <inheritdoc cref="Load(Int32, Topic?, Boolean)"/>
110+
[Obsolete("This overload has been removed in preference for Load(string, Topic, Boolean).")]
111+
Topic? Load(string? uniqueKey, bool isRecursive);
112+
109113
/// <summary>
110114
/// Loads a specific version of a <see cref="Topic"/> based on its <paramref name="topicId"/> and <paramref name="version
111115
/// "/>.

OnTopic/Repositories/ObservableTopicRepository.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ public event EventHandler<TopicRenameEventArgs>? TopicRenamed {
208208
/// <inheritdoc />
209209
public abstract Topic? Load(string? uniqueKey = null, Topic? referenceTopic = null, bool isRecursive = true);
210210

211+
/// <inheritdoc cref="Load(Int32, Topic?, Boolean)"/>
212+
[Obsolete("This overload has been removed in preference for Load(string, Topic, Boolean).")]
213+
public Topic? Load(string? uniqueKey, bool isRecursive) => throw new NotImplementedException();
214+
211215
/// <inheritdoc />
212216
public abstract Topic? Load(Topic topic, DateTime version);
213217

0 commit comments

Comments
 (0)