/// <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.Data.OData.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> /// Loads the supported, OData-specific serializable annotations into their in-memory representations. /// </summary> /// <param name="model">The <see cref="IEdmModel"/> to process.</param> public static void LoadODataAnnotations(this IEdmModel model) { ExceptionUtils.CheckArgumentNotNull(model, "model"); LoadODataAnnotations(model, ODataConstants.DefaultMaxEntityPropertyMappingsPerType); }
public static void LoadODataAnnotations(this IEdmModel model, IEdmEntityType entityType) { ExceptionUtils.CheckArgumentNotNull <IEdmModel>(model, "model"); ExceptionUtils.CheckArgumentNotNull <IEdmEntityType>(entityType, "entityType"); model.LoadODataAnnotations(entityType, 100); }
/// <summary> /// Sets the custom instance annotations. /// </summary> /// <param name="value">The new value to set.</param> internal void SetInstanceAnnotations(ICollection <ODataInstanceAnnotation> value) { DebugUtils.CheckNoExternalCallers(); ExceptionUtils.CheckArgumentNotNull(value, "value"); this.instanceAnnotations = value; }
public static void SetMimeType(this IEdmModel model, IEdmElement annotatable, string mimeType) { ExceptionUtils.CheckArgumentNotNull <IEdmModel>(model, "model"); ExceptionUtils.CheckArgumentNotNull <IEdmElement>(annotatable, "annotatable"); model.SetODataAnnotation(annotatable, "MimeType", mimeType); }
public static void LoadODataAnnotations(this IEdmModel model) { ExceptionUtils.CheckArgumentNotNull <IEdmModel>(model, "model"); model.LoadODataAnnotations(100); }
public static void SetHttpMethod(this IEdmModel model, IEdmElement annotatable, string httpMethod) { ExceptionUtils.CheckArgumentNotNull <IEdmModel>(model, "model"); ExceptionUtils.CheckArgumentNotNull <IEdmElement>(annotatable, "annotatable"); model.SetODataAnnotation(annotatable, "HttpMethod", httpMethod); }
public static void SetIsDefaultEntityContainer(this IEdmModel model, IEdmEntityContainer entityContainer, bool isDefaultContainer) { ExceptionUtils.CheckArgumentNotNull <IEdmModel>(model, "model"); ExceptionUtils.CheckArgumentNotNull <IEdmEntityContainer>(entityContainer, "entityContainer"); SetBooleanAnnotation(model, entityContainer, "IsDefaultEntityContainer", isDefaultContainer); }
public static void SaveODataAnnotations(this IEdmModel model, IEdmEntityType entityType) { ExceptionUtils.CheckArgumentNotNull <IEdmModel>(model, "model"); ExceptionUtils.CheckArgumentNotNull <IEdmEntityType>(entityType, "entityType"); SaveODataAnnotationsImplementation(model, entityType); }
public static void SetHasDefaultStream(this IEdmModel model, IEdmEntityType entityType, bool hasStream) { ExceptionUtils.CheckArgumentNotNull <IEdmModel>(model, "model"); ExceptionUtils.CheckArgumentNotNull <IEdmEntityType>(entityType, "entityType"); SetBooleanAnnotation(model, entityType, "HasStream", hasStream); }
private void VerifyCanWriteStartNavigationLink(bool synchronousCall, ODataNavigationLink navigationLink) { ExceptionUtils.CheckArgumentNotNull <ODataNavigationLink>(navigationLink, "navigationLink"); this.VerifyNotDisposed(); this.VerifyCallAllowed(synchronousCall); }
private void VerifyCanWriteEntityReferenceLink(ODataEntityReferenceLink entityReferenceLink, bool synchronousCall) { ExceptionUtils.CheckArgumentNotNull <ODataEntityReferenceLink>(entityReferenceLink, "entityReferenceLink"); this.VerifyNotDisposed(); this.VerifyCallAllowed(synchronousCall); }
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.OData.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); }
internal override IEnumerable <ODataPayloadKind> DetectPayloadKind(IODataRequestMessage requestMessage, ODataPayloadKindDetectionInfo detectionInfo) { ExceptionUtils.CheckArgumentNotNull <IODataRequestMessage>(requestMessage, "requestMessage"); ExceptionUtils.CheckArgumentNotNull <ODataPayloadKindDetectionInfo>(detectionInfo, "detectionInfo"); return(DetectPayloadKindImplementation(detectionInfo.ContentType)); }
internal override Task <IEnumerable <ODataPayloadKind> > DetectPayloadKindAsync(IODataResponseMessageAsync responseMessage, ODataPayloadKindDetectionInfo detectionInfo) { ExceptionUtils.CheckArgumentNotNull <IODataResponseMessageAsync>(responseMessage, "responseMessage"); ExceptionUtils.CheckArgumentNotNull <ODataPayloadKindDetectionInfo>(detectionInfo, "detectionInfo"); return(TaskUtils.GetTaskForSynchronousOperation <IEnumerable <ODataPayloadKind> >(() => DetectPayloadKindImplementation(detectionInfo.ContentType))); }