You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Simple.Odata.Client library provides a Boolean property IgnoreUnmappedProperties to alter the behavior of validations that occur in the underlying Microsoft.OData library class ODataMessageReaderSettings. However, that class has many more options that could be set. In my current use case we have a class that contains an ID property set by the service on Insert. In the metadata, that property is marked as required causing the Simple.OData.Client to throw an error before sending an Insert request. I do realize that we can use the overloads of the Set method that allows us to specify the properties to send. Their are workarounds. But overall, I feel that Metadata validations have gotten in the way of things we wish to do more than prevent us from making mistakes. Please feel free to disagree with me, but I am assuming Microsoft made these options available for a reason in their library.
//
// Summary:
// Validation kinds used in ODataMessageReaderSettings and ODataMessageWriterSettings.
[Flags]
public enum ValidationKinds
{
All = -1,
None = 0,
ThrowOnDuplicatePropertyNames = 1,
ThrowOnUndeclaredPropertyForNonOpenType = 2,
ThrowIfTypeConflictsWithMetadata = 4
}
The text was updated successfully, but these errors were encountered:
In my current use case we have a class that contains an ID property set by the service on Insert. In the metadata, that property is marked as required causing the Simple.OData.Client to throw an error before sending an Insert request
I'm having the same issue. What does the workaround look like? Setting validations to none does not seem to work, it throws:
An error occured when creating batch with reason The given key 'type' was not present in the dictionary.
Currently the Simple.Odata.Client library provides a Boolean property IgnoreUnmappedProperties to alter the behavior of validations that occur in the underlying Microsoft.OData library class ODataMessageReaderSettings. However, that class has many more options that could be set. In my current use case we have a class that contains an ID property set by the service on Insert. In the metadata, that property is marked as required causing the Simple.OData.Client to throw an error before sending an Insert request. I do realize that we can use the overloads of the Set method that allows us to specify the properties to send. Their are workarounds. But overall, I feel that Metadata validations have gotten in the way of things we wish to do more than prevent us from making mistakes. Please feel free to disagree with me, but I am assuming Microsoft made these options available for a reason in their library.
//
// Summary:
// Validation kinds used in ODataMessageReaderSettings and ODataMessageWriterSettings.
[Flags]
public enum ValidationKinds
{
All = -1,
None = 0,
ThrowOnDuplicatePropertyNames = 1,
ThrowOnUndeclaredPropertyForNonOpenType = 2,
ThrowIfTypeConflictsWithMetadata = 4
}
The text was updated successfully, but these errors were encountered: