Esempio n. 1
0
 /// <summary>Sets the URI of the metadata document.</summary>
 /// <param name="value">The URI of the metadata document.</param>
 /// <param name="selectClause">The select clause.</param>
 public void SetMetadataDocumentUri(Uri value, string selectClause)
 {
     this.metadataDocumentUri = new ODataMetadataDocumentUri(value)
     {
         SelectClause = selectClause
     };
 }
Esempio n. 2
0
        /// <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.OData.ODataMessageWriterSettings" /> class with specified settings.</summary>
        /// <param name="other">The specified settings.</param>
        public ODataMessageWriterSettings(ODataMessageWriterSettings other)
            : base(other)
        {
            ExceptionUtils.CheckArgumentNotNull(other, "other");

            this.acceptCharSets               = other.acceptCharSets;
            this.acceptMediaTypes             = other.acceptMediaTypes;
            this.BaseUri                      = other.BaseUri;
            this.DisableMessageStreamDisposal = other.DisableMessageStreamDisposal;
            this.format              = other.format;
            this.useFormat           = other.useFormat;
            this.Version             = other.Version;
            this.metadataDocumentUri = other.metadataDocumentUri;
            this.atomFormatStartEntryXmlCustomizationCallback = other.atomFormatStartEntryXmlCustomizationCallback;
            this.atomFormatEndEntryXmlCustomizationCallback   = other.atomFormatEndEntryXmlCustomizationCallback;
            this.JsonPCallback                    = other.JsonPCallback;
            this.shouldIncludeAnnotation          = other.shouldIncludeAnnotation;
            this.AutoComputePayloadMetadataInJson = other.AutoComputePayloadMetadataInJson;
            this.AutoGeneratedUrlsShouldPutKeyValueInDedicatedSegment = other.AutoGeneratedUrlsShouldPutKeyValueInDedicatedSegment;
            this.alwaysUseDefaultXmlNamespaceForRootElement           = other.alwaysUseDefaultXmlNamespaceForRootElement;
            this.UndeclaredPropertyBehaviorKinds = other.UndeclaredPropertyBehaviorKinds;

            // NOTE: writer behavior is immutable; copy by reference is ok.
            this.writerBehavior = other.writerBehavior;
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the selected properties from the given <paramref name="metadataDocumentUri"/>.
        /// </summary>
        /// <param name="metadataDocumentUri">The <see cref="ODataMetadataDocumentUri"/> instance to get the selected properties node from.</param>
        /// <returns>The selected properties node instance.</returns>
        /// <remarks>This can be a property on <see cref="ODataMetadataDocumentUri"/>. Having it as an extension method here so we don't have to do the null check at the call site.</remarks>
        internal static SelectedPropertiesNode SelectedProperties(this ODataMetadataDocumentUri metadataDocumentUri)
        {
            DebugUtils.CheckNoExternalCallers();

            if (metadataDocumentUri == null)
            {
                return(SelectedPropertiesNode.Create(null));
            }

            return(SelectedPropertiesNode.Create(metadataDocumentUri.SelectClause));
        }
Esempio n. 4
0
 /// <summary>Sets the URI of the metadata document.</summary>
 /// <param name="value">The URI of the metadata document.</param>
 public void SetMetadataDocumentUri(Uri value)
 {
     this.metadataDocumentUri = value == null ? null : new ODataMetadataDocumentUri(value);
 }