mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
fixed service registration for event handlers and executors.
This commit is contained in:
17
NzbDrone.Common/Messaging/MessageExtensions.cs
Normal file
17
NzbDrone.Common/Messaging/MessageExtensions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace NzbDrone.Common.Messaging
|
||||
{
|
||||
public static class MessageExtensions
|
||||
{
|
||||
public static string GetExecutorName(this Type commandType)
|
||||
{
|
||||
if (!typeof(ICommand).IsAssignableFrom(commandType))
|
||||
{
|
||||
throw new ArgumentException("commandType must implement IExecute");
|
||||
}
|
||||
|
||||
return string.Format("I{0}Executor", commandType.Name);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user