/// <summary> /// Sets a meta-data items' content. /// </summary> /// <param name="item">The item.</param> /// <param name="tag">The tag that specifies the context (usually the namespace).</param> /// <param name="content">The content.</param> /// <returns><c>true</c> if the content is set, <c>false</c> otherwise.</returns> public bool SetMetaDataItem(MetaDataItem item, string tag, string content) { try { MetadataEntity metadataEntity = null; _metadata.TryGetValue(item + "|" + tag, out metadataEntity); if (metadataEntity == null) { metadataEntity = new MetadataEntity() { PartitionKey = _wiki, RowKey = item + "|" + tag, Content = content }; _context.AddObject(MetadataTable, metadataEntity); } else { metadataEntity.Content = content; _context.UpdateObject(metadataEntity); } _context.SaveChangesStandard(); // Invalidate metadataCache _metadataCache = null; return(true); } catch (Exception ex) { throw ex; } }
/// <summary> /// Gets a meta-data item's content. /// </summary> /// <param name="item">The item.</param> /// <param name="tag">The tag that specifies the context (usually the namespace).</param> /// <returns>The content.</returns> public string GetMetaDataItem(MetaDataItem item, string tag) { try { MetadataEntity metadataEntity = null; _metadata.TryGetValue(item + "|" + tag, out metadataEntity); return(metadataEntity == null ? "" : metadataEntity.Content + ""); } catch (Exception ex) { throw ex; } }