コード例 #1
0
        internal static object Create(PaginatedResourceInfo pri)
        {
            pri.Verify();

            MethodInfo openCreateMethod = typeof(PaginatedResourceFactory).GetMethod(
                "Create",
                BindingFlags.Static | BindingFlags.NonPublic,
                null,
                new Type[] { typeof(object), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string) },
                null);

            Type       clientType         = pri.Client.GetType();
            MethodInfo fetcherMethod      = clientType.GetMethod(pri.MethodName);
            Type       responseType       = fetcherMethod.ReturnType;
            Type       listItemType       = GetPropertyTypeFromPath(responseType, pri.ItemListPropertyPath);
            MethodInfo closedCreateMethod = openCreateMethod.MakeGenericMethod(listItemType.GetGenericArguments());

            return(closedCreateMethod.Invoke(null, new object[] { pri.Client, pri.MethodName, pri.Request, pri.TokenRequestPropertyPath, pri.TokenResponsePropertyPath, pri.ItemListPropertyPath }));
        }
コード例 #2
0
        public static object Create <TItemType, TRequestType, TResponseType>(PaginatedResourceInfo pri)
        {
            pri.Verify();

            return(Create <TItemType, TRequestType, TResponseType>(pri.Client, pri.MethodName, pri.Request, pri.TokenRequestPropertyPath, pri.TokenResponsePropertyPath, pri.ItemListPropertyPath));
        }