Exemple #1
0
        /// <summary>
        /// Writes an <see cref="ODataProperty"/> as message payload.
        /// </summary>
        /// <param name="property">The property to write.</param>
        private void WritePropertyImplementation(ODataProperty property)
        {
            ODataAtomPropertyAndValueSerializer atomPropertyAndValueSerializer = new ODataAtomPropertyAndValueSerializer(this);

            atomPropertyAndValueSerializer.WriteTopLevelProperty(property);
        }
        private string SerializeProperty(ODataProperty odataProperty)
        {
            MemoryStream outputStream = new MemoryStream();
            ODataAtomOutputContext atomOutputContext = this.CreateAtomOutputContext(this.model, outputStream);
            var serializer = new ODataAtomPropertyAndValueSerializer(atomOutputContext);

            serializer.WriteTopLevelProperty(odataProperty);
            atomOutputContext.Flush();
            outputStream.Position = 0;
            string result = new StreamReader(outputStream).ReadToEnd();

            return result;
        }
 /// <summary>
 /// Writes an <see cref="ODataProperty"/> as message payload.
 /// </summary>
 /// <param name="property">The property to write.</param>
 private void WritePropertyImplementation(ODataProperty property)
 {
     ODataAtomPropertyAndValueSerializer atomPropertyAndValueSerializer = new ODataAtomPropertyAndValueSerializer(this);
     atomPropertyAndValueSerializer.WriteTopLevelProperty(property);
 }