-
Notifications
You must be signed in to change notification settings - Fork 180
Description
Assemblies affected
ASP.NET Core OData 9.3.0
Describe the bug
When performing a PUT operation on an entity with a derived type, properties specific to the derived type that are not included in the request payload are not reset to their default values. Instead, they retain their previous values if the entity instance is more derived than the Delta type. It is unclear if this is by design or an implementation oversight, as the OData specification (v4.01 Section 11.4.3) states that omitted properties should be set to their default values, but does not explicitly call out behavior for properties present only on a more derived type than the tracked Delta.
Reproduce steps
- Define a base class and a derived class with additional properties.
- Create an entity of the derived class and persist it with non-default values for derived properties.
- Send a PUT request targeting the base type or a less-derived Delta that omits the derived properties from the payload.
- Observe that the derived properties are not reset.
Data Model
Expected behavior
All omitted properties, including those specific to the derived type, should be reset to their default values as per OData PUT semantics.
Screenshots
Additional Context
Additional context
It appears that omitted properties in the derived type are not present in the Delta's updateChangedProperty and updateUnchangeProperty sets, so they are neither reset during PUT.
Is this behavior intentional or a bug?