Пример #1
0
        private static string WriteToStream(ODataFormat format, Action <ODataPayloadElement> writeToStream, ODataPayloadElement payload)
        {
            string contentType = null;

            if (format == ODataFormat.Json)
            {
                payload.Accept(new ODataPayloadJsonNormalizer());
                contentType = MimeTypes.ApplicationJsonLight;
            }
            else
            {
                ExceptionUtilities.Assert(format == ODataFormat.Atom, "Format not supported: {0}", format);
                contentType = MimeTypes.ApplicationAtomXml;
            }

            writeToStream(payload);
            return(contentType);
        }
Пример #2
0
 /// <summary>
 /// Gets the actions that have been queued during context lifetime.
 /// </summary>
 /// <returns>Collection of actions.</returns>
 public ReadOnlyCollection <Action <IAsyncContinuation> > GetQueuedActions()
 {
     ExceptionUtilities.Assert(this.usingStack.Count == 0, "Using stack should be empty when done executing queued actions");
     return(this.queuedActions.AsReadOnly());
 }