private static Type GetResponseType(Type type) { return type == null || !type.IsGenericType ? type : GetEnumerableType(type); }