/// <summary> /// Sets the custom instance annotations. /// </summary> /// <param name="value">The new value to set.</param> internal void SetInstanceAnnotations(ICollection <ODataInstanceAnnotation> value) { ExceptionUtils.CheckArgumentNotNull(value, "value"); this.instanceAnnotations = value; }
/// <summary>Returns the format used by the message reader for reading the payload.</summary> /// <returns>The format used by the messageReader for reading the payload.</returns> /// <param name="messageReader">The <see cref="T:Microsoft.OData.Core.ODataMessageReader" /> to get the read format from.</param> /// <remarks>This method must only be called once reading has started. /// This means that a read method has been called on the <paramref name="messageReader"/> or that a reader (for entries, feeds, collections, etc.) has been created. /// If the method is called prior to that it will throw.</remarks> public static ODataFormat GetReadFormat(ODataMessageReader messageReader) { ExceptionUtils.CheckArgumentNotNull(messageReader, "messageReader"); return(messageReader.GetFormat()); }
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.OData.Core.ProjectedPropertiesAnnotation" /> class.</summary> /// <param name="projectedPropertyNames">The enumeration of projected property names.</param> public ProjectedPropertiesAnnotation(IEnumerable <string> projectedPropertyNames) { ExceptionUtils.CheckArgumentNotNull(projectedPropertyNames, "projectedPropertyNames"); this.projectedProperties = new HashSet <string>(projectedPropertyNames, StringComparer.Ordinal); }
/// <summary> /// Creates a new instance of the type annotation for a collection value. /// </summary> /// <param name="collectionType">The type of the collection value (required).</param> public ODataTypeAnnotation(IEdmCollectionTypeReference collectionType) { ExceptionUtils.CheckArgumentNotNull(collectionType, "collectionType"); this.type = collectionType; }
/// <summary> /// Gets the <see cref="ODataPreferenceHeader"/> instance to get or set preferences on the "Preference-Applied" header of the <paramref name="responseMessage"/>. /// </summary> /// <param name="responseMessage">The response message to get or set the "Preference-Applied" header.</param> /// <returns>Returns the <see cref="ODataPreferenceHeader"/> instance to get or set preferences on the "Preference-Applied" header of the <paramref name="responseMessage"/>.</returns> public static ODataPreferenceHeader PreferenceAppliedHeader(this IODataResponseMessage responseMessage) { ExceptionUtils.CheckArgumentNotNull(responseMessage, "responseMessage"); return(new ODataPreferenceHeader(responseMessage)); }
/// <summary> /// Creates a new instance of the type annotation for an entity value. /// </summary> /// <param name="navigationSource">The navigation source the entity belongs to (required).</param> /// <param name="entityType">The entity type of the entity value if not the base type of the entity set (optional).</param> public ODataTypeAnnotation(IEdmNavigationSource navigationSource, IEdmEntityType entityType) { ExceptionUtils.CheckArgumentNotNull(entityType, "entityType"); this.navigationSource = navigationSource; this.type = entityType.ToTypeReference(/*isNullable*/ true); }