Skip to content
Open
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
2 changes: 2 additions & 0 deletions src/Microsoft.OData.Core/CacheTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ internal static class CachedTasks
internal static readonly Task<JsonNodeType> PrimitiveValue = Task.FromResult(JsonNodeType.PrimitiveValue);

internal static readonly Task<JsonNodeType> Property = Task.FromResult(JsonNodeType.Property);

internal static readonly Task<string> StringNull = Task.FromResult<string>(null);
}
}
68 changes: 64 additions & 4 deletions src/Microsoft.OData.Core/Json/ODataAnnotationNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.OData.Json
{
#region Namespaces
using System;
using System.Collections.Generic;
using System.Collections.Frozen;
using System.Diagnostics;
using Microsoft.OData.Core;
#endregion Namespaces
Expand All @@ -21,8 +21,8 @@ internal static class ODataAnnotationNames
/// <summary>
/// Hash set of known odata annotation names that have special meanings to OData Lib.
/// </summary>
internal static readonly HashSet<string> KnownODataAnnotationNames =
new HashSet<string>(
internal static readonly FrozenSet<string> KnownODataAnnotationNames =
FrozenSet.ToFrozenSet(
new[]
{
ODataContext,
Expand All @@ -43,7 +43,7 @@ internal static class ODataAnnotationNames
ODataDeltaLink,
ODataRemoved,
ODataDelta,
ODataNull,
ODataNull
},
StringComparer.Ordinal);

Expand Down Expand Up @@ -107,6 +107,66 @@ internal static class ODataAnnotationNames
/// </summary>
internal const string ODataNull = "odata.null";

/// <summary>The OData Context annotation name with no prefix.</summary>
internal const string ODataContextNoPrefix = "context";

/// <summary>The OData Type annotation name with no prefix.</summary>
internal const string ODataTypeNoPrefix = "type";

/// <summary>The OData ID annotation name with no prefix.</summary>
internal const string ODataIdNoPrefix = "id";

/// <summary>The OData etag annotation name with no prefix.</summary>
internal const string ODataETagNoPrefix = "etag";

/// <summary>The OData edit link annotation name with no prefix.</summary>
internal const string ODataEditLinkNoPrefix = "editLink";

/// <summary>The OData read link annotation name with no prefix.</summary>
internal const string ODataReadLinkNoPrefix = "readLink";

/// <summary>The OData media edit link annotation name with no prefix.</summary>
internal const string ODataMediaEditLinkNoPrefix = "mediaEditLink";

/// <summary>The OData media read link annotation name with no prefix.</summary>
internal const string ODataMediaReadLinkNoPrefix = "mediaReadLink";

/// <summary>The OData media content type annotation name with no prefix.</summary>
internal const string ODataMediaContentTypeNoPrefix = "mediaContentType";

/// <summary>The OData media etag annotation name with no prefix.</summary>
internal const string ODataMediaETagNoPrefix = "mediaEtag";

/// <summary>The 'count' annotation name with no prefix.</summary>
internal const string ODataCountNoPrefix = "count";

/// <summary>The 'nextLink' annotation name with no prefix.</summary>
internal const string ODataNextLinkNoPrefix = "nextLink";

/// <summary>The 'navigationLink' annotation name with no prefix.</summary>
internal const string ODataNavigationLinkUrlNoPrefix = "navigationLink";

/// <summary>The 'bind' annotation name with no prefix.</summary>
internal const string ODataBindNoPrefix = "bind";

/// <summary>The 'associationLink' annotation name with no prefix.</summary>
internal const string ODataAssociationLinkUrlNoPrefix = "associationLink";

/// <summary>The 'deltaLink' annotation name with no prefix.</summary>
internal const string ODataDeltaLinkNoPrefix = "deltaLink";

/// <summary>The 'removed' annotation name with no prefix.</summary>
internal const string ODataRemovedNoPrefix = "removed";

/// <summary>The 'delta' annotation name with no prefix.</summary>
internal const string ODataDeltaNoPrefix = "delta";

/// <summary>
/// The OData Null annotation name with no prefix. This is an OData 3.0 protocol element
/// used for compatibility with 6.x library version.
/// </summary>
internal const string ODataNullNoPrefix = "null";

/// <summary>
/// Returns true if the <paramref name="annotationName"/> starts with "odata.", false otherwise.
/// </summary>
Expand Down
Loading