Open NMSAzulX opened 5 months ago
编号 | 相似度 | ISSUE |
---|---|---|
1 | 73.03% | [Tasks]: 有关【UT IS DEMO】相关功能的规划与任务细化 (意见搜集与讨论) |
2 | 69.63% | [Tasks]: 有关【动态方法模板】相关功能的规划与任务细化 (意见搜集与讨论) |
3 | 69.63% | [Tasks]: 有关【可视化管道配置】相关功能的规划与任务细化 (意见搜集与讨论) |
该条自动推荐信息来自于 nms-bot.
Query
//创建查询实例
GithubQueryData query = new()
{
repository = new GithubRepository("DotNetCore","Natasha")
{
issue = new(297)
{
title = "",
url = "",
id=""
}
}
};
//获取查询结果
var (data, msg) = await query.GetExecuteResultAsync();
var issue = data!.repository!.issue!;
Mutation 不获取实体结果
//创建方法实例
GithubMutationData add = new()
{
addReaction = new(issue.id!, GithubReactionContent.HOORAY)
};
//获取方法结果
(var result, msg) = await add.GetExecuteStateAsync();
if (result)
{
Console.WriteLine("succeed");
}
else
{
Console.WriteLine(msg);
}
Mutation 获取实体结果
GithubMutationData remove = new()
{
removeReaction = new(issue.id!, GithubReactionContent.HOORAY)
{
//创建返回体实例
reaction = new()
{
id = "",
content = 0,
createdAt = DateTime.Now
}
}
};
//获取方法结果
(var reData, msg) = await remove.GetExecuteResultAsync();
if (reData != null)
{
var reaction = reData!.removeReaction!.reaction!;
Console.WriteLine("succeed");
Console.WriteLine(reaction.id);
Console.WriteLine(reaction.content);
Console.WriteLine(reaction.createdAt);
}
else
{
Console.WriteLine(msg);
}
集合查询
GithubQueryData query = new()
{
repository = new GithubRepository("DotNetCore", "Natasha")
{
//需要查询的集合
labels = new GithubConnection<GithubLabel>()
{
nodes =
[
//创建一个元素:为了定义要查询返回的结构
new GithubLabel()
{
id = "",
name = "",
}
]
}
}
};
//获取所有数据
var labels = await query.GetCollectionResultAsync(repository => repository!.labels!);
//获取最先的 5 个
var labels = await query.GetCollectionResultAsync(repository => repository!.labels!, 5);
//获取最后的 5 个
var labels = await query.GetCollectionResultAsync(repository => repository!.labels!, -5);
获取某集合总数
var count = await query.GetTotalAsync(repository => repository!.labels!);
Console.WriteLine(count);
分页查询
GithubQueryData query = new()
{
repository = new GithubRepository("DotNetCore", "Natasha")
{
//需要查询的集合
labels = new GithubConnection<GithubLabel>()
{
nodes =
[
//创建一个元素:为了定义要查询返回的结构
new GithubLabel()
{
id = "",
name = "",
}
]
}
}
};
//从第一页取 5 条数据
var labels = await query.GetCollectionResultAsync(repository => repository!.labels!, 5);
//自动设置下一页游标
query.repository!.labels.SetNextPage();
//从下一页取 5 条数据
labels = await query.GetCollectionResultAsync(repository => repository!.labels!, 5);
//查询重置
query.repository.labels.Reset();
//从排尾取 5 条数据
labels = await query.GetCollectionResultAsync(repository => repository!.labels!, -5);
//自动设置排尾的前一页
query.repository!.labels.SetNextPage();
//从前一页取 5 条数据
labels = await query.GetCollectionResultAsync(repository => repository!.labels!, -5);
📃 计划清单 (Tasklist).