/// <summary> /// Adds a label to the collection. /// </summary> /// <param name="label">The label to add.</param> public void Add(Label label) { var error = NotNullRule <Label> .Instance.Validate(null, label); if (error != null) { throw new ValidationException <Label>(label, new[] { error }); } var json = TrelloConfiguration.JsonFactory.Create <IJsonParameter>(); json.String = label.Id; var endpoint = EndpointFactory.Build(EntityRequestType.Card_Write_AddLabel, new Dictionary <string, object> { { "_id", OwnerId } }); JsonRepository.Execute(Auth, endpoint, json); Items.Add(label); _context.Expire(); }
/// <summary> /// Marks the card to be refreshed the next time data is accessed. /// </summary> public void Refresh() { _context.Expire(); }