public static Type GetContextType(this Type behaviorType) { var behaviorInterface = behaviorType.GetBehaviorInterface(); return behaviorInterface.GetGenericArguments()[0]; }