小编Zah*_*aya的帖子

没有使用Instagram API的分页信息

我用这个URL来获得最近关于特定媒体tag喜欢cats使用Instagram API.该URL是这样的:

https://api.instagram.com/v1/tags/cats/media/recent?access_token=*****
Run Code Online (Sandbox Code Playgroud)

不幸的是,没有数据,我得到了下面warningpagination:

{"pagination":{"deprecation_warning":"next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead"},"meta":{"code":200},"data":[]}
Run Code Online (Sandbox Code Playgroud)

我怎样才能得到min_tag_idmin_tag_id?为什么没有data

url pagination json instagram instagram-api

9
推荐指数
1
解决办法
8378
查看次数

如何只获得Enumerable的类型?

我想IEnumerable按类型分隔变量.我的代码是这样的:

if (type is IEnumerable)
{
    var listGenericType = type.GetType().GetGenericTypeDefinition().Name;
    listGenericType = listGenericType.Substring(0, listGenericType.IndexOf('`'));
    if (listGenericType == "List") {
        //do something
    }

    else if (listGenericType == "HashSet") {
        //do something
    }
}
Run Code Online (Sandbox Code Playgroud)

当我使用type.GetType().GetGenericTypeDefinition().NamelistGenericType是类似List`1HashSet`1但我想它喜欢ListHashSet.因此,我曾经Substring处理过这个问题!

无论如何在没有postProcessing string类型的情况下处理这个问题?我的意思是下面的代码:

if (type is IEnumerable)
{
    var listGenericType = type.GetType().GetGenericTypeDefinitionWithoutAnyNeedForPostProcessing();
    if (listGenericType == "List") {
        //do something
    }

    else if (listGenericType == "HashSet") {
        //do something
    }
}
Run Code Online (Sandbox Code Playgroud)

c# ienumerable

5
推荐指数
1
解决办法
114
查看次数

标签 统计

c# ×1

ienumerable ×1

instagram ×1

instagram-api ×1

json ×1

pagination ×1

url ×1