我使用的是dillenmeister的Trello.Net API包装器,我看到从卡上移除附件是几个月前添加的,但我使用的调用(Trello.Cards.RemoveAttachment())调用了CardId和IAttachmentId。我已经知道如何创建一个CardId (new CardID(Card.ID)),但是我不知道如何创建它正在寻找的IAttachmentID。
我有一个附件对象,可以从那里获取ID,但它是string类型的。
发布于 2013-01-22 05:01:58
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类实现了ICardId。如果有Card,则不需要创建CardId对象。只要使用实际的Card即可。
// Example: Fetch all members assigned to a card
var card = trello.Cards.WithId("a card id");
var members = trello.Members.ForCard(card);不过,无论如何都可能需要一个AttachmentId类。你的用例是什么?
https://stackoverflow.com/questions/14445732
复制相似问题