/// <summary> /// Start writing a feed. /// </summary> /// <param name="feed">The feed to write.</param> protected override void StartFeed(ODataFeed feed) { Debug.Assert(feed != null, "feed != null"); // <atom:feed> this.writer.WriteStartElement(AtomConstants.AtomNamespacePrefix, AtomConstants.AtomFeedElementName, AtomConstants.AtomNamespace); if (this.IsTopLevel) { ODataAtomWriterUtils.WriteBaseUriAndDefaultNamespaceAttributes(this.writer, this.BaseUri); if (feed.Count.HasValue) { ODataAtomWriterUtils.WriteCount(this.writer, feed.Count.Value, false); } } }
/// <summary> /// Start writing an entry. /// </summary> /// <param name="entry">The entry to write.</param> protected override void StartEntry(ODataEntry entry) { Debug.Assert(entry != null, "entry != null"); // <entry> this.writer.WriteStartElement(AtomConstants.AtomNamespacePrefix, AtomConstants.AtomEntryElementName, AtomConstants.AtomNamespace); if (this.IsTopLevel) { ODataAtomWriterUtils.WriteBaseUriAndDefaultNamespaceAttributes(this.writer, this.BaseUri); } string etag = entry.ETag; if (etag != null) { // TODO, ckerer: if this is a top-level entry also put the ETag into the headers. ODataAtomWriterUtils.WriteETag(this.writer, etag); } }