如何使用 Trello.NET 从 Trello 获取所有板? [英] How can I get all boards from Trello using Trello.NET?

查看:35
本文介绍了如何使用 Trello.NET 从 Trello 获取所有板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

ITrello trello = new Trello("MyAppToken");
trello.Authorize("MyUserToken");
Member me = trello.Members.Me();
var cards = trello.Cards.ForMe();
var allboards = trello.Boards.ForMe();

所以我拿到了我所有的卡片,没有任何问题.但是我怎样才能得到我所有的板子呢?它总是 null,我不明白是什么问题.我的用户和应用程序令牌有效.

So I got all my cards without any problems. But how can I get all my boards? It's always null and I don't understand what is the problem. My user and application tokens are valid.

我的 me 对象不为空,并且我有关于我的帐户的信息.

My me object is not null and I have information about my account.

我错过了什么?谢谢!

UPD:我什至无法通过板 ID 获取板.我从卡片中获得了 boardId.

UPD: I can't even get board by board ID. I got the boardId from the card.

推荐答案

我终于明白了!

当我从 trello API 获取 json 对象并尝试对其进行序列化时出现异常.在 Trello.JSON 中包含颜色的枚举没有足够的颜色用于 API.所以我添加了缺失的颜色.

When I got json object from trello API and tried to serialize it there was an exception. Enum that contains colors in Trello.JSON had not enough colors for API. So I added missing colors.

public enum Color
{
    Green,
    Yellow,
    Orange,
    Red,
    Purple,
    Blue, 
    Turquoise, 
    Lightgreen,
    Pink,
    Sky,
    Lime,
    Black
}

这篇关于如何使用 Trello.NET 从 Trello 获取所有板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆