/// <summary> /// Removes the requested tag item mapping for the specified tag and item /// </summary> /// <param name="item">Item for which to remove the tag mapping</param> /// <param name="tag">Tag for which to remove the mapping</param> public void RemoveTagMapping(Item item, Tag tag) { // find the mapping TagItemMapping tim = (from t in context.TagItemMappingCollection where t.ItemID == item.ID && t.TagID == tag.ID select t).FirstOrDefault(); if (tim != default(TagItemMapping)) { // delete it from the context. context.DeleteTagItemMapping(tim); } }
/// <summary> /// Adds a new tag to item mapping. /// </summary> /// <param name="item">Item to which a tag is being mapped</param> /// <param name="tag">Tag to which an item is being mapped</param> public void AddTagMapping(Item item, Tag tag) { // Here we ensure that the referential integrity is correct. // In the UI, there is no way to add a duplicate mapping, so // uniqueness is insured. Other applications may have to do // an explicit check here. TagItemMapping tim = new TagItemMapping() { ItemID = item.ID, TagID = tag.ID, UserID = UserID }; context.AddTagItemMapping(tim); }
public void DeleteTagItemMapping(TagItemMapping entity) { base.DeleteItem<TagItemMapping>(entity); }
public void AddTagItemMapping(TagItemMapping entity) { base.AddItem<TagItemMapping>(entity); }
public void DeleteTagItemMapping(TagItemMapping entity) { base.DeleteItem <TagItemMapping>(entity); }
public void AddTagItemMapping(TagItemMapping entity) { base.AddItem <TagItemMapping>(entity); }