diff --git a/Pilz.Net/Api/ApiServer.cs b/Pilz.Net/Api/ApiServer.cs index fdd5455..4845f75 100644 --- a/Pilz.Net/Api/ApiServer.cs +++ b/Pilz.Net/Api/ApiServer.cs @@ -190,6 +190,13 @@ public class ApiServer : IApiServer return; } + RegisterHandler(handler, attribute, throwOnError); + } + + public virtual void RegisterHandler(Delegate handler, ApiMessageHandlerAttribute attribute, bool throwOnError) + { + var method = handler.Method; + // Resolves parameters var url = attribute.Route; var useRegEx = false; diff --git a/Pilz.Net/Api/IApiServer.cs b/Pilz.Net/Api/IApiServer.cs index f1569d7..d3dd7b4 100644 --- a/Pilz.Net/Api/IApiServer.cs +++ b/Pilz.Net/Api/IApiServer.cs @@ -28,4 +28,6 @@ public interface IApiServer void RegisterHandler(Delegate handler); void RegisterHandler(Delegate handler, bool throwOnError); + + void RegisterHandler(Delegate handler, ApiMessageHandlerAttribute attribute, bool throwOnError); }