Ejemplo n.º 1
0
 /// <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);
 }
 internal ODataBatchOperationReadStreamWithLength(ODataBatchReaderStream batchReaderStream, IODataBatchOperationListener listener, int length) : base(batchReaderStream, listener)
 {
     ExceptionUtils.CheckIntegerNotNegative(length, "length");
     this.length = length;
 }
Ejemplo n.º 3
0
 /// <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());
 }
Ejemplo n.º 4
0
 private void VerifyCanWriteStartNavigationLink(bool synchronousCall, ODataNavigationLink navigationLink)
 {
     ExceptionUtils.CheckArgumentNotNull <ODataNavigationLink>(navigationLink, "navigationLink");
     this.VerifyNotDisposed();
     this.VerifyCallAllowed(synchronousCall);
 }
Ejemplo n.º 5
0
 private void VerifyCanWriteEntityReferenceLink(ODataEntityReferenceLink entityReferenceLink, bool synchronousCall)
 {
     ExceptionUtils.CheckArgumentNotNull <ODataEntityReferenceLink>(entityReferenceLink, "entityReferenceLink");
     this.VerifyNotDisposed();
     this.VerifyCallAllowed(synchronousCall);
 }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
 internal override IEnumerable <ODataPayloadKind> DetectPayloadKind(IODataRequestMessage requestMessage, ODataPayloadKindDetectionInfo detectionInfo)
 {
     ExceptionUtils.CheckArgumentNotNull <IODataRequestMessage>(requestMessage, "requestMessage");
     ExceptionUtils.CheckArgumentNotNull <ODataPayloadKindDetectionInfo>(detectionInfo, "detectionInfo");
     return(DetectPayloadKindImplementation(detectionInfo.ContentType));
 }
Ejemplo n.º 8
0
 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)));
 }