Skip to content

Commit

Permalink
Make RegisterHandler() obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-dudarev committed Mar 5, 2024
1 parent 066e5c2 commit 4fb7213
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/VirtoCommerce.Platform.Core/Bus/IHandlerRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace VirtoCommerce.Platform.Core.Bus
{
public interface IHandlerRegistrar
{
[Obsolete("Use IApplicationBuilder.RegisterEventHandler<>()", DiagnosticId = "VC0008", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions")]
void RegisterHandler<T>(Func<T, CancellationToken, Task> handler) where T : IMessage;
}
}
3 changes: 3 additions & 0 deletions src/VirtoCommerce.Platform.Core/Bus/InProcessBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ public void RegisterEventHandler<T>(Func<T, Task> handler)
public void RegisterEventHandler<T>(Func<T, CancellationToken, Task> handler)
where T : IEvent
{
#pragma warning disable VC0008 // Type or member is obsolete
RegisterHandler(handler);
#pragma warning restore VC0008 // Type or member is obsolete
}

[Obsolete("Use IApplicationBuilder.RegisterEventHandler<>()", DiagnosticId = "VC0008", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions")]
public void RegisterHandler<T>(Func<T, CancellationToken, Task> handler)
where T : IMessage
{
Expand Down

0 comments on commit 4fb7213

Please sign in to comment.