问题
Here is my code:
ITrello trello = new Trello("MyAppToken");
trello.Authorize("MyUserToken");
Member me = trello.Members.Me();
var cards = trello.Cards.ForMe();
var allboards = trello.Boards.ForMe();
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.
My me object is not null and I have information about my account.
What did I miss? Thank you!
UPD: I can't even get board by board ID. I got the boardId from the card.
回答1:
Finally I get it!
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
}
回答2:
FYI, at the time of my post the Trello.NET library no longer works. It doesn't provide access to boards, cards, or lists. The project hasn't been updated since 2014. It's essentially been abandoned.
I would recommend either making API calls directly or finding an alternative library.
来源:https://stackoverflow.com/questions/32678405/how-can-i-get-all-boards-from-trello-using-trello-net