aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/ServiceController.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-08-27 13:34:55 -0400
committerGitHub <noreply@github.com>2017-08-27 13:34:55 -0400
commitf3ee129bd9e88e8768221ba176bc8356f9b240e3 (patch)
tree72dc082f77629e8d70f764d175433b40ac4c02d0 /Emby.Server.Implementations/Services/ServiceController.cs
parent4f8684a16b1102056bd2b527dcbd585b78dd8000 (diff)
parentfa6bec94b59cf850246c5d0757b9279d080643d7 (diff)
Merge pull request #2847 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/Services/ServiceController.cs')
-rw-r--r--Emby.Server.Implementations/Services/ServiceController.cs40
1 files changed, 7 insertions, 33 deletions
diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.cs
index 4ad56411a..c3970b22f 100644
--- a/Emby.Server.Implementations/Services/ServiceController.cs
+++ b/Emby.Server.Implementations/Services/ServiceController.cs
@@ -29,13 +29,6 @@ namespace Emby.Server.Implementations.Services
}
}
- private Type[] GetGenericArguments(Type type)
- {
- return type.GetTypeInfo().IsGenericTypeDefinition
- ? type.GetTypeInfo().GenericTypeParameters
- : type.GetTypeInfo().GenericTypeArguments;
- }
-
public void RegisterService(HttpListenerHost appHost, Type serviceType)
{
var processedReqs = new HashSet<Type>();
@@ -50,38 +43,19 @@ namespace Emby.Server.Implementations.Services
ServiceExecGeneral.CreateServiceRunnersFor(requestType, actions);
- var returnMarker = GetTypeWithGenericTypeDefinitionOf(requestType, typeof(IReturn<>));
- var responseType = returnMarker != null ?
- GetGenericArguments(returnMarker)[0]
- : mi.ReturnType != typeof(object) && mi.ReturnType != typeof(void) ?
- mi.ReturnType
- : Type.GetType(requestType.FullName + "Response");
+ //var returnMarker = GetTypeWithGenericTypeDefinitionOf(requestType, typeof(IReturn<>));
+ //var responseType = returnMarker != null ?
+ // GetGenericArguments(returnMarker)[0]
+ // : mi.ReturnType != typeof(object) && mi.ReturnType != typeof(void) ?
+ // mi.ReturnType
+ // : Type.GetType(requestType.FullName + "Response");
RegisterRestPaths(appHost, requestType);
- appHost.AddServiceInfo(serviceType, requestType, responseType);
+ appHost.AddServiceInfo(serviceType, requestType);
}
}
- private static Type GetTypeWithGenericTypeDefinitionOf(Type type, Type genericTypeDefinition)
- {
- foreach (var t in type.GetTypeInfo().ImplementedInterfaces)
- {
- if (t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == genericTypeDefinition)
- {
- return t;
- }
- }
-
- var genericType = FirstGenericType(type);
- if (genericType != null && genericType.GetGenericTypeDefinition() == genericTypeDefinition)
- {
- return genericType;
- }
-
- return null;
- }
-
public static Type FirstGenericType(Type type)
{
while (type != null)