Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultRestierSerializerProvider" /> class.
 /// </summary>
 /// <param name="rootContainer">The container to get the service</param>
 public DefaultRestierSerializerProvider(IServiceProvider rootContainer) : base(rootContainer)
 {
     this.resourceSetSerializer = new RestierResourceSetSerializer(this);
     this.primitiveSerializer   = new RestierPrimitiveSerializer();
     this.rawSerializer         = new RestierRawSerializer();
     this.resourceSerializer    = new RestierResourceSerializer(this);
     this.collectionSerializer  = new RestierCollectionSerializer(this);
     this.enumSerializer        = new RestierEnumSerializer(this);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultRestierSerializerProvider" /> class.
        /// </summary>
        /// <param name="rootContainer">The container to get the service</param>
        /// <param name="payloadValueConverter">The OData payload value converter to use.</param>
        public DefaultRestierSerializerProvider(IServiceProvider rootContainer, ODataPayloadValueConverter payloadValueConverter) : base(rootContainer)
        {
            Ensure.NotNull(rootContainer, nameof(rootContainer));
            Ensure.NotNull(payloadValueConverter, nameof(payloadValueConverter));

            this.resourceSetSerializer = new RestierResourceSetSerializer(this);
            this.primitiveSerializer   = new RestierPrimitiveSerializer(payloadValueConverter);
            this.rawSerializer         = new RestierRawSerializer(payloadValueConverter);
            this.resourceSerializer    = new RestierResourceSerializer(this);
            this.collectionSerializer  = new RestierCollectionSerializer(this);
            this.enumSerializer        = new RestierEnumSerializer(this);
        }