Skip to content

Commit

Permalink
Add support for operations with no bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepizzo committed Mar 21, 2017
1 parent a7b29e9 commit 8e965e9
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
{
Expand All @@ -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
Expand Down

0 comments on commit 8e965e9

Please sign in to comment.