-
Notifications
You must be signed in to change notification settings - Fork 468
bulk ops deserialization #2686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ElizabethOkerio
merged 5 commits into
OData:master
from
ElizabethOkerio:feature/update_bulk_ops_deserialization
Sep 12, 2022
Merged
bulk ops deserialization #2686
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8176c82
bulk ops deserialization
ElizabethOkerio e696b1d
update based on review comments
ElizabethOkerio a86163e
update based on review comments
ElizabethOkerio 86c0f35
update public api
ElizabethOkerio 36494d1
fix build error
ElizabethOkerio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/Microsoft.AspNet.OData.Shared/Common/SRResources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
src/Microsoft.AspNet.OData.Shared/DataModificationExceptionType.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| //----------------------------------------------------------------------------- | ||
| // <copyright file="MessageType.cs" company=".NET Foundation"> | ||
| // Copyright (c) .NET Foundation and Contributors. All rights reserved. | ||
| // See License.txt in the project root for license information. | ||
| // </copyright> | ||
| //------------------------------------------------------------------------------ | ||
|
|
||
| using System; | ||
|
|
||
| namespace Org.OData.Core.V1 | ||
| { | ||
| /// <summary> | ||
| /// Represents a message type. | ||
| /// </summary> | ||
| public class MessageType | ||
| { | ||
| /// <summary> | ||
| /// Code of message. | ||
| /// </summary> | ||
| public string Code { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Actual message. | ||
| /// </summary> | ||
| public string Message { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Severity of message. | ||
| /// </summary> | ||
| public string Severity { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Target of message. | ||
| /// </summary> | ||
| public string Target { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Details of message. | ||
| /// </summary> | ||
| public string Details { get; set; } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Represents an exception type. | ||
| /// </summary> | ||
| public abstract class ExceptionType | ||
| { | ||
| /// <summary> | ||
| /// Represents a message type. | ||
| /// </summary> | ||
| public MessageType MessageType { get; set; } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Represents the type of exception thrown during a data modification operation. | ||
| /// </summary> | ||
| public class DataModificationExceptionType : ExceptionType | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="DataModificationExceptionType"/> class. | ||
| /// </summary> | ||
| public DataModificationExceptionType(DataModificationOperationKind failedOperation) | ||
| { | ||
| this.FailedOperation = failedOperation; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Represents the kind of data modification operation. | ||
| /// </summary> | ||
| public DataModificationOperationKind FailedOperation { get; } | ||
|
|
||
| /// <summary> | ||
| /// Represents the response code. | ||
| /// </summary> | ||
| public Int16 ResponseCode { get; set; } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Enumerates the kind of data modification operations. | ||
| /// </summary> | ||
| public enum DataModificationOperationKind | ||
| { | ||
| /// <summary> | ||
| /// Represents an insert operation. | ||
| /// </summary> | ||
| Insert, | ||
|
|
||
| /// <summary> | ||
| /// Represents an update operation. | ||
| /// </summary> | ||
| Update, | ||
|
|
||
| /// <summary> | ||
| /// Represents an insert or update operation if item already exists. | ||
| /// </summary> | ||
| Upsert, | ||
|
|
||
| /// <summary> | ||
| /// Represents a delete data modification operation. | ||
| /// </summary> | ||
| Delete, | ||
|
|
||
| /// <summary> | ||
| /// Represents an action or function invocation. | ||
| /// </summary> | ||
| Invoke, | ||
|
|
||
| /// <summary> | ||
| /// Represents adding a link between entities. | ||
| /// </summary> | ||
| Link, | ||
|
|
||
| /// <summary> | ||
| /// Represents removing a link between entities. | ||
| /// </summary> | ||
| Unlink | ||
| } | ||
| } | ||
120 changes: 120 additions & 0 deletions
120
src/Microsoft.AspNet.OData.Shared/DeltaDeletedEntityObjectOfT.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| //----------------------------------------------------------------------------- | ||
| // <copyright file="DeltaDeletedEntityObjectOfT.cs" company=".NET Foundation"> | ||
| // Copyright (c) .NET Foundation and Contributors. All rights reserved. | ||
| // See License.txt in the project root for license information. | ||
| // </copyright> | ||
| //------------------------------------------------------------------------------ | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Reflection; | ||
| using Microsoft.OData; | ||
|
|
||
| namespace Microsoft.AspNet.OData | ||
| { | ||
| /// <summary> | ||
| /// Represents an <see cref="IDeltaDeletedEntityObject"/> with a backing CLR type. | ||
| /// Used to hold the deleted entry object in the delta feed payload. | ||
| /// </summary> | ||
| [NonValidatingParameterBinding] | ||
|
ElizabethOkerio marked this conversation as resolved.
|
||
| public class DeltaDeletedEntityObject<TStructuralType> : Delta<TStructuralType>, IDeltaDeletedEntityObject where TStructuralType : class | ||
|
ElizabethOkerio marked this conversation as resolved.
|
||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>. | ||
| /// </summary> | ||
| public DeltaDeletedEntityObject() | ||
| : this(typeof(TStructuralType)) | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/> | ||
| /// </summary> | ||
| /// <param name="structuralType">The derived entity type or complex type for which the changes will be tracked. | ||
| /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>. | ||
| /// </param> | ||
| public DeltaDeletedEntityObject(Type structuralType) | ||
| : this(structuralType, dynamicDictionaryPropertyInfo: null, instanceAnnotationsPropertyInfo: null) | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>. | ||
| /// </summary> | ||
| /// <param name="structuralType">The derived entity type or complex type for which the changes will be tracked. | ||
| /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>. | ||
| /// </param> | ||
| /// <param name="updatableProperties">Properties that can be updated.</param> | ||
| public DeltaDeletedEntityObject(Type structuralType, IEnumerable<string> updatableProperties) | ||
| : this(structuralType, updatableProperties, dynamicDictionaryPropertyInfo: null, instanceAnnotationsPropertyInfo: null) | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>. | ||
| /// </summary> | ||
| /// <param name="structuralType">The derived entity type or complex type for which the changes will be tracked. | ||
| /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>. | ||
| /// </param> | ||
| /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for instance annotations</param> | ||
| public DeltaDeletedEntityObject(Type structuralType, PropertyInfo instanceAnnotationsPropertyInfo) | ||
| : this(structuralType, dynamicDictionaryPropertyInfo: null, instanceAnnotationsPropertyInfo) | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>. | ||
| /// </summary> | ||
| /// <param name="structuralType">The derived entity type or complex type for which the changes will be tracked. | ||
| /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>. | ||
| /// </param> | ||
| /// <param name="dynamicDictionaryPropertyInfo">The property info that is used as dictionary of dynamic | ||
| /// properties. <c>null</c> means this entity type is not open.</param> | ||
| /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for instance annotations</param> | ||
| public DeltaDeletedEntityObject(Type structuralType, PropertyInfo dynamicDictionaryPropertyInfo, PropertyInfo instanceAnnotationsPropertyInfo) | ||
| : this(structuralType, updatableProperties: null, dynamicDictionaryPropertyInfo, instanceAnnotationsPropertyInfo) | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>. | ||
| /// </summary> | ||
| /// <param name="structuralType">The derived entity type or complex type for which the changes will be tracked. | ||
| /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>. | ||
| /// </param> | ||
| /// <param name="updatableProperties">Properties that can be updated.</param> | ||
| /// <param name="dynamicDictionaryPropertyInfo">The property info that is used as dictionary of dynamic | ||
| /// properties. <c>null</c> means this entity type is not open.</param> | ||
| /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for instance annotations</param> | ||
| public DeltaDeletedEntityObject(Type structuralType, IEnumerable<string> updatableProperties, PropertyInfo dynamicDictionaryPropertyInfo, PropertyInfo instanceAnnotationsPropertyInfo) | ||
| : this(structuralType, updatableProperties, dynamicDictionaryPropertyInfo, false, instanceAnnotationsPropertyInfo) | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>. | ||
| /// </summary> | ||
| /// <param name="structuralType">The derived entity type or complex type for which the changes will be tracked. | ||
| /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>. | ||
| /// </param> | ||
| /// <param name="updatableProperties">Properties that can be updated.</param> | ||
| /// <param name="dynamicDictionaryPropertyInfo">The property info that is used as dictionary of dynamic | ||
| /// properties. <c>null</c> means this entity type is not open.</param> | ||
| /// <param name="isComplexType">To determine if the entity is a complex type</param> | ||
| /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for instance annotations</param> | ||
| public DeltaDeletedEntityObject(Type structuralType, IEnumerable<string> updatableProperties, PropertyInfo dynamicDictionaryPropertyInfo, bool isComplexType, PropertyInfo instanceAnnotationsPropertyInfo) | ||
| : base(structuralType, updatableProperties, dynamicDictionaryPropertyInfo, isComplexType, instanceAnnotationsPropertyInfo) | ||
| { | ||
| DeltaKind = EdmDeltaEntityKind.DeletedEntry; | ||
| } | ||
|
|
||
| /// <inheritdoc /> | ||
| public Uri Id { get; set; } | ||
|
|
||
| /// <inheritdoc /> | ||
| public DeltaDeletedEntryReason? Reason { get; set; } | ||
|
|
||
| /// <inheritdoc /> | ||
| public string NavigationSource { get; set; } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.