Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Microsoft.AspNetCore.OData/Edm/ODataNullValueExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//-----------------------------------------------------------------------------
// <copyright file="ODataNullValueExtensions.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 Microsoft.OData;

namespace Microsoft.AspNetCore.OData.Edm
{
internal class ODataNullValueExtensions
{
public static readonly ODataNullValue NullValue = new ODataNullValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public sealed override ODataValue CreateODataValue(object graph, IEdmTypeReferen
ODataEnumValue value = CreateODataEnumValue(graph, expectedType.AsEnum(), writeContext);
if (value == null)
{
return new ODataNullValue();
return ODataNullValueExtensions.NullValue;
}

return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.AspNetCore.OData.Common;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.OData.Edm;
using Microsoft.OData;
using Microsoft.OData.Edm;

Expand Down Expand Up @@ -65,7 +64,7 @@ public sealed override ODataValue CreateODataValue(object graph, IEdmTypeReferen
ODataPrimitiveValue value = CreateODataPrimitiveValue(graph, expectedType.AsPrimitive(), writeContext);
if (value == null)
{
return new ODataNullValue();
return ODataNullValueExtensions.NullValue;
}

return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private static IEnumerable<ODataProperty> CreateODataPropertiesFromDynamicType(E
property = new ODataProperty
{
Name = prop.Key,
Value = new ODataNullValue()
Value = ODataNullValueExtensions.NullValue
};
}
else
Expand Down Expand Up @@ -618,7 +618,7 @@ public virtual void AppendDynamicProperties(ODataResource resource, SelectExpand
dynamicProperties.Add(new ODataProperty
{
Name = dynamicProperty.Key,
Value = new ODataNullValue()
Value = ODataNullValueExtensions.NullValue
});

continue;
Expand Down
16 changes: 1 addition & 15 deletions src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,20 +1102,6 @@
<param name="clrType">The type to test.</param>
<returns>True if the type is a DateTime; false otherwise.</returns>
</member>
<member name="M:Microsoft.AspNetCore.OData.Common.TypeHelper.IsDateOnly(System.Type)">
<summary>
Determine if a type is a <see cref="T:System.DateOnly"/>.
</summary>
<param name="clrType">The type to test.</param>
<returns>True if the type is a DateOnly; false otherwise.</returns>
</member>
<member name="M:Microsoft.AspNetCore.OData.Common.TypeHelper.IsTimeOnly(System.Type)">
<summary>
Determine if a type is a <see cref="T:System.TimeOnly"/>.
</summary>
<param name="clrType">The type to test.</param>
<returns>True if the type is a TimeOnly; false otherwise.</returns>
</member>
<member name="M:Microsoft.AspNetCore.OData.Common.TypeHelper.IsTimeSpan(System.Type)">
<summary>
Determine if a type is a TimeSpan.
Expand Down Expand Up @@ -5907,7 +5893,7 @@
<summary>
Read OData item.
</summary>
<param name="reader">The odata reader.</param>
<param name="reader">The OData reader.</param>
<param name="itemsStack">The item stack.</param>
<param name="topLevelItem">The top level item.</param>
</member>
Expand Down