我正在使用 dillenmeister 的 Trello.Net API 包装器,我看到几个月前添加了从卡中删除附件的功能,但我正在使用 ( Trello.Cards.RemoveAttachment()) 的调用需要 aCardId和 an IAttachmentId。我已经想出了如何创建CardId( new CardID(Card.ID)),但我没有看到如何创建IAttachmentID它正在寻找的。
我有附件对象,可以ID从那里得到,但那是字符串类型的。
我正在使用 dillenmeister 的 Trello.Net API 包装器,我看到几个月前添加了从卡中删除附件的功能,但我正在使用 ( Trello.Cards.RemoveAttachment()) 的调用需要 aCardId和 an IAttachmentId。我已经想出了如何创建CardId( new CardID(Card.ID)),但我没有看到如何创建IAttachmentID它正在寻找的。
我有附件对象,可以ID从那里得到,但那是字符串类型的。
类Attachment本身实现IAttachmentId.
// Example: Remove all attachments with the name "DevSupport" from a card
var card = trello.Cards.WithId("a card id");
foreach (var attachment in card.Attachments.Where(a => a.Name == "DevSupport"))
trello.Cards.RemoveAttachment(card, attachment);
许多其他对象也是如此,例如Card类 implements ICardId。CardId如果您有一个Card. 只需使用实际的Card.
// Example: Fetch all members assigned to a card
var card = trello.Cards.WithId("a card id");
var members = trello.Members.ForCard(card);
AttachmentId无论如何,可能需要一堂课。你的用例是什么?