/// <summary>
 /// Initializes a new instance of the <see cref="DefaultODataSerializerProvider"/> class.
 /// </summary>
 public DefaultODataSerializerProvider()
 {
     _feedSerializer = new ODataFeedSerializer(this);
     _deltaFeedSerializer = new ODataDeltaFeedSerializer(this);
     _collectionSerializer = new ODataCollectionSerializer(this);
     _complexTypeSerializer = new ODataComplexTypeSerializer(this);
     _entityTypeSerializer = new ODataEntityTypeSerializer(this);
 }
示例#2
0
        private static ODataProperty CreateCollectionProperty(ODataCollectionSerializer serializer, object graph, IEdmTypeReference expectedType, string elementName,
                                                              ODataSerializerContext writeContext)
        {
            Contract.Assert(elementName != null);
            var property = serializer.CreateODataValue(graph, expectedType, writeContext);

            if (property != null)
            {
                return(new ODataProperty
                {
                    Name = elementName,
                    Value = property
                });
            }
            else
            {
                return(null);
            }
        }