Skip to content

Commit 8c24e7a

Browse files
committed
Suppress Obsolete warning in TopicViewModelLookupService
Since the `ListTopicViewModel` has been marked as deprecated (11c606f), it will get a warning when referenced. This is a good thing. But as this is already known and accounted for, we want to disable that warning when registering the view model in the `TopicViewModelLookupService`; this will be removed once the deprecated class is removed.
1 parent 11c606f commit 8c24e7a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

OnTopic.ViewModels/TopicViewModelLookupService.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,18 @@ public TopicViewModelLookupService(IEnumerable<Type>? types = null) : base(types
5050
\-----------------------------------------------------------------------------------------------------------------------*/
5151
TryAdd(typeof(ItemTopicViewModel));
5252
TryAdd(typeof(ContentItemTopicViewModel));
53-
TryAdd(typeof(ListTopicViewModel));
5453
TryAdd(typeof(LookupListItemTopicViewModel));
5554
TryAdd(typeof(SlideTopicViewModel));
5655

56+
/*------------------------------------------------------------------------------------------------------------------------
57+
| Add obsolete types
58+
>-------------------------------------------------------------------------------------------------------------------------
59+
| These will be removed in the next major version of OnTopic.
60+
\-----------------------------------------------------------------------------------------------------------------------*/
61+
#pragma warning disable CS0618 // Type or member is obsolete
62+
TryAdd(typeof(ListTopicViewModel));
63+
#pragma warning restore CS0618 // Type or member is obsolete
64+
5765
/*------------------------------------------------------------------------------------------------------------------------
5866
| Add support types
5967
\-----------------------------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)