public void UntagEntityWithTagId( ITaggableEntity entity, Guid tagId, IDocumentSession tenantSession, IDocumentSession entitySession) { var tag = tenantSession.Load <Tag>(string.Format(TagIdFormat, tagId)); this.UntagEntityFromTag(entity, tag, entitySession); }
/// <summary>Votes for the specified tags on the specified entity.</summary> /// <param name="entity">The entity to tag.</param> /// <param name="vote">The vote to apply to the tags.</param> /// <param name="tags">The tags to vote for.</param> /// <returns>This submission request.</returns> public TagSubmission Add(ITaggableEntity entity, TagVote vote, params string[] tags) { foreach (var tag in tags) { this.Add(tag, vote, entity.EntityType, entity.Id); } return(this); }
/// <summary>Votes for the specified tag on the specified entity.</summary> /// <param name="tag">The tag to vote for.</param> /// <param name="vote">The vote to apply to the tag.</param> /// <param name="entity">The entity to tag.</param> /// <returns>This submission request.</returns> public TagSubmission Add(string tag, TagVote vote, ITaggableEntity entity) { if (tag == null) { throw new ArgumentNullException(nameof(tag)); } if (entity == null) { throw new ArgumentNullException(nameof(entity)); } return(this.Add(tag, vote, entity.EntityType, entity.MbId)); }
/// <summary>Votes for the specified tags on the specified entity.</summary> /// <param name="entity">The entity to tag.</param> /// <param name="vote">The vote to apply to the tags.</param> /// <param name="tags">The tags to vote for.</param> /// <returns>This submission request.</returns> public TagSubmission Add(ITaggableEntity entity, TagVote vote, params string[] tags) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } if (tags == null) { throw new ArgumentNullException(nameof(tags)); } foreach (var tag in tags) { this.Add(tag, vote, entity.EntityType, entity.MbId); } return(this); }
/// <summary>Votes for the specified tag on the specified entity.</summary> /// <param name="tag">The tag to vote for.</param> /// <param name="vote">The vote to apply to the tag.</param> /// <param name="entity">The entity to tag.</param> /// <returns>This submission request.</returns> public TagSubmission Add(string tag, TagVote vote, ITaggableEntity entity) { return(this.Add(tag, vote, entity.EntityType, entity.Id)); }
public void UntagEntityFromTag(ITaggableEntity entity, Tag tag, IDocumentSession aSession) { entity.Tags.Remove(tag); aSession.SaveChanges(); }
public void UntagEntityWithTagId(ITaggableEntity entity, Guid tagId, IDocumentSession tenantSession) { UntagEntityWithTagId(entity, tagId, tenantSession, tenantSession); }
public void TagEntityWithTag(ITaggableEntity entity, Tag tag, IDocumentSession aSession) { entity.Tags.Add(tag); aSession.SaveChanges(); }