diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataPrimitiveSerializer.cs b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataPrimitiveSerializer.cs index f9956f51b..931067c07 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataPrimitiveSerializer.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataPrimitiveSerializer.cs @@ -102,7 +102,10 @@ internal static void AddTypeNameAnnotationAsNeeded(ODataPrimitiveValue primitive typeName = primitiveType.FullName(); } - primitive.TypeAnnotation = new ODataTypeAnnotation(typeName); + if (typeName != null) + { + primitive.TypeAnnotation = new ODataTypeAnnotation(typeName); + } } internal static ODataPrimitiveValue CreatePrimitive(object value, IEdmPrimitiveTypeReference primitiveType, diff --git a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.xml b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.xml index a4a21f166..47202d3a0 100644 --- a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.xml +++ b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.xml @@ -5659,7 +5659,17 @@ Gets the value of the property with the given name. - ft.AspNetCore.OData.Formatter.Value.NullEdmComplexObject.#ctor(Microsoft.OData.Edm.IEdmComplexTypeReference)"> + The name of the property to get. + When this method returns, contains the value of the property with the given name, if the property is found; + otherwise, null. The parameter is passed uninitialized. + true if the instance contains the property with the given name; otherwise, false. + + + + Represents an that is null. + + + Initializes a new instance of the class. @@ -6468,18 +6478,6 @@ Looks up a localized string similar to Cannot find key '{0}' in the '{1}' type.. - - - Looks up a localize.AspNetCore.OData.SRResources.CannotDeserializeUnknownProperty"> - - Looks up a localized string similar to The property '{0}' does not exist on type '{1}'. Make sure to only use property names that are defined by the type.. - - - - - Looks up a localized string similar to Cannot find key '{0}' in the '{1}' type.. - - Looks up a localized string similar to Cannot find parameter '{0}' is in the operation '{1}'.. @@ -10734,7 +10732,23 @@ Gets the raw $select query value from the incoming request Uri if exists. - + + Gets the raw $expand query value from the incoming request Uri if exists. + + + + + Gets the raw $count query value from the incoming request Uri if exists. + + + + + Gets the raw $format query value from the incoming request Uri if exists. + + + + Gets the raw $skiptoken query value from the incoming request Uri if exists. @@ -11081,15 +11095,6 @@ Information about the other query options. The new after the skiptoken query has been applied to. - - - Apply the $skiptoken query to the given IQueryable. - - The original . - The query settings to use while applyingn. - Information about the other query options. - The new after the skiptoken query has been applied to. - Apply the $skiptoken query to the given IQueryable. @@ -13275,7 +13280,20 @@ Initializes a new instance of the class. The wrapper action import. - The target navigation sNetCore.OData.Routing.Template.ActionImportSegmentTemplate.Segment"> + The target navigation source. it could be null. + + + + Initializes a new instance of the class. + + The operation import segment. + + + + Gets the wrapped action import. + + + Gets the action import segment. @@ -14084,19 +14102,3 @@ -ummary> - The value segment. - - - - Gets the value segment. - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.OData.E2E.Tests/OpenType/TypedOpenTypeTest.cs b/test/Microsoft.AspNetCore.OData.E2E.Tests/OpenType/TypedOpenTypeTest.cs index 85167a415..02b00dfc8 100644 --- a/test/Microsoft.AspNetCore.OData.E2E.Tests/OpenType/TypedOpenTypeTest.cs +++ b/test/Microsoft.AspNetCore.OData.E2E.Tests/OpenType/TypedOpenTypeTest.cs @@ -467,7 +467,7 @@ public async Task PatchOpenComplexTypeProperty(string mode) response = await client.SendAsync(request); Assert.Equal(HttpStatusCode.OK, response.StatusCode); content = await response.Content.ReadAsObject(); - Assert.Equal(6, content.Count); // @odata.context + 3 declared properties + 1 dynamic properties + 1 new dynamic properties + Assert.Equal(7, content.Count); // @odata.context + 3 declared properties + 2 dynamic properties + 1 new dynamic properties Assert.Equal("NewCity", content["City"]); // updated Assert.Equal("1 Microsoft Way", content["Street"]); Assert.Equal("US", content["CountryCode"]); @@ -587,7 +587,7 @@ public async Task PutOpenComplexTypeProperty(string mode) // Assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); content = await response.Content.ReadAsObject(); - Assert.Equal(5, content.Count); // @odata.context + 3 declared properties + 1 new dynamic properties + Assert.Equal(6, content.Count); // @odata.context + 3 declared properties + 2 new dynamic properties Assert.Equal("NewCity", content["City"]); // updated Assert.Equal("NewStreet", content["Street"]); // updated Assert.Equal("US", content["CountryCode"]);