Permalink
Browse files

Add support for operations with no bindings.

  • Loading branch information...
mikepizzo committed Mar 21, 2017
1 parent a7b29e9 commit 8e965e9f89951dbfea510e67cbbe89e4f75fa69b
Showing with 12 additions and 6 deletions.
  1. +12 −6 src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPathExtensions.cs
@@ -13,8 +13,7 @@ namespace Microsoft.OData.UriParser
using System.Linq;
using Microsoft.OData.Edm;
using Microsoft.OData.Metadata;
/// <summary>
/// Extension methods for <see cref="ODataPath"/>. These method provide convenince functions.
/// TODO: Implement this class and it's visitors. These are stubs.
@@ -180,10 +179,10 @@ public static string ToContextUrlPathString(this ODataPath path)
ODataPathSegment priorSegment = null;
foreach (ODataPathSegment segment in path)
{
bool isBoundPath = false;
OperationSegment operationSegment = segment as OperationSegment;
if (operationSegment != null)
{
bool isBoundPath = false;
// Check for entity set path of bound operation
if (priorSegment != null)
{
@@ -207,10 +206,17 @@ public static string ToContextUrlPathString(this ODataPath path)
}
}
if (!isBoundPath && operationSegment.EntitySet != null)
if (!isBoundPath)
{
pathString.Clear();
pathString.Append(operationSegment.EntitySet.Name);
if (operationSegment.EntitySet != null)
{
pathString.Clear();
pathString.Append(operationSegment.EntitySet.Name);
}
else
{
return null;
}
}
}
else

0 comments on commit 8e965e9

Please sign in to comment.