コード例 #1
0
        /// <summary>
        /// Validates the <paramref name="serializationInfo"/> instance.
        /// </summary>
        /// <param name="serializationInfo">The serialization info instance to validate.</param>
        /// <returns>The <paramref name="serializationInfo"/> instance.</returns>
        internal static ODataDeltaSerializationInfo Validate(ODataDeltaSerializationInfo serializationInfo)
        {
            if (serializationInfo != null)
            {
                ExceptionUtils.CheckArgumentNotNull(serializationInfo.NavigationSourceName, "serializationInfo.EntitySetName");
            }

            return serializationInfo;
        }
コード例 #2
0
            /// <summary>
            /// Convert DeltaSerializationInfo to FeedAndEntrySerializationInfo.
            /// </summary>
            /// <param name="serializationInfo">The DeltaSerializationInfo to convert.</param>
            /// <returns>The converted FeedAndEntrySerializationInfo.</returns>
            internal static ODataFeedAndEntrySerializationInfo ToFeedAndEntrySerializationInfo(ODataDeltaSerializationInfo serializationInfo)
            {
                if (serializationInfo == null)
                {
                    return null;
                }

                return new ODataFeedAndEntrySerializationInfo
                {
                    NavigationSourceName = serializationInfo.NavigationSourceName,
                    NavigationSourceKind = EdmNavigationSourceKind.EntitySet,
                    NavigationSourceEntityTypeName = JsonConstants.JsonNullLiteral, // Won't write out in delta (deleted) entries.
                    ExpectedTypeName = JsonConstants.JsonNullLiteral // Same as above.
                };
            }
コード例 #3
0
 /// <summary>
 /// Constructor to create a new delta link scope.
 /// </summary>
 /// <param name="state">The writer state of this scope.</param>
 /// <param name="link">The link for the new scope.</param>
 /// <param name="serializationInfo">The serialization info for the current entry.</param>
 /// <param name="navigationSource">The navigation source we are going to write entities for.</param>
 /// <param name="entityType">The entity type for the entries in the feed to be written (or null if the entity set base type should be used).</param>
 /// <param name="writerBehavior">The <see cref="ODataWriterBehavior"/> instance controlling the behavior of the writer.</param>
 /// <param name="selectedProperties">The selected properties of this scope.</param>
 /// <param name="odataUri">The ODataUri info of this scope.</param>
 internal JsonLightDeltaLinkScope(WriterState state, ODataItem link, ODataDeltaSerializationInfo serializationInfo, IEdmNavigationSource navigationSource, IEdmEntityType entityType, ODataWriterBehavior writerBehavior, SelectedPropertiesNode selectedProperties, ODataUri odataUri)
     : base(state, link, serializationInfo, navigationSource, entityType, writerBehavior, selectedProperties, odataUri)
 {
 }
コード例 #4
0
            /// <summary>
            /// Constructor to create a new delta link scope.
            /// </summary>
            /// <param name="state">The writer state of this scope.</param>
            /// <param name="link">The link for the new scope.</param>
            /// <param name="serializationInfo">The serialization info for the current entry.</param>
            /// <param name="navigationSource">The navigation source we are going to write entities for.</param>
            /// <param name="entityType">The entity type for the entries in the feed to be written (or null if the entity set base type should be used).</param>
            /// <param name="writerBehavior">The <see cref="ODataWriterBehavior"/> instance controlling the behavior of the writer.</param>
            /// <param name="selectedProperties">The selected properties of this scope.</param>
            /// <param name="odataUri">The ODataUri info of this scope.</param>
            protected DeltaLinkScope(WriterState state, ODataItem link, ODataDeltaSerializationInfo serializationInfo, IEdmNavigationSource navigationSource, IEdmEntityType entityType, ODataWriterBehavior writerBehavior, SelectedPropertiesNode selectedProperties, ODataUri odataUri)
                : base(state, link, navigationSource, entityType, selectedProperties, odataUri)
            {
                Debug.Assert(link != null, "link != null");
                Debug.Assert(
                    state == WriterState.DeltaLink && link is ODataDeltaLink ||
                    state == WriterState.DeltaDeletedLink && link is ODataDeltaDeletedLink,
                    "link must be either DeltaLink or DeltaDeletedLink.");
                Debug.Assert(writerBehavior != null, "writerBehavior != null");

                this.serializationInfo = DeltaConverter.ToFeedAndEntrySerializationInfo(serializationInfo);
            }