protected override async Task <Stream> WriteLinkContentAsync(string linkIdent)
        {
            var message = new ODataRequestMessage();

            using (var messageWriter = new ODataMessageWriter(message, GetWriterSettings(), _model))
            {
                var link = new ODataEntityReferenceLink {
                    Url = Utils.CreateAbsoluteUri(_session.Settings.UrlBase, linkIdent)
                };
                messageWriter.WriteEntityReferenceLink(link);

#if SILVERLIGHT
                return(message.GetStream());
#else
                return(await message.GetStreamAsync());
#endif
            }
        }
#pragma warning restore 1998

#pragma warning disable 1998
        public override async Task <HttpRequestMessage> EndBatchAsync()
        {
#if SILVERLIGHT
            if (_pendingChangeSet)
            {
                _batchWriter.WriteEndChangeset();
            }
            _batchWriter.WriteEndBatch();
            var stream = _requestMessage.GetStream();
#else
            if (_pendingChangeSet)
            {
                await _batchWriter.WriteEndChangesetAsync();
            }
            await _batchWriter.WriteEndBatchAsync();

            var stream = await _requestMessage.GetStreamAsync();
#endif
            return(CreateMessageFromStream(stream, _requestMessage.Url, _requestMessage.GetHeader));
        }