Skip to content

Commit

Permalink
fixes the failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhg committed May 15, 2023
1 parent e4f6fb6 commit 2f76583
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Microsoft.OData.Core/ODataWriterCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2941,10 +2941,18 @@ private void PromoteNestedResourceInfoScope(ODataItem content)
}
else
{
ODataResourceBase resource = content as ODataResourceBase;
newScope.ResourceType = resource != null
? GetResourceType(resource)
: GetResourceSetType(content as ODataResourceSetBase);
if (content is ODataResourceBase resource)
{
newScope.ResourceType = string.IsNullOrEmpty(resource.TypeName) ?
EdmUntypedStructuredType.Instance :
GetResourceType(resource);
}
else if (content is ODataResourceSetBase resourceSet)
{
newScope.ResourceType = string.IsNullOrEmpty(resourceSet.TypeName) ?
EdmUntypedStructuredType.Instance :
GetResourceSetType(resourceSet);
}
}
}
}
Expand Down

0 comments on commit 2f76583

Please sign in to comment.