Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: Segment parser should not consider return type of a bound action for figuring out entity set. [596]

$
0
0
NOTE: This is a different issue probably due to the same root cause as of issue #595.

Expected: segment entityset should be "Customers"
Actual: segment entityset is "SalesPeople"

I used the ODataPathParserTests for this scenario.

Definition:
-----------
builder.Entity<Customer>().Action("GetSalesPeople").ReturnsCollectionFromEntitySet<SalesPerson>("SalesPeople");

Test:
-----
[Fact]
public void CanParseActionBoundToEntitySegment()
{
// Arrange
string testUrl = "http://myservice/Customers(112)/GetSalesPeople";
string expectedText = "GetSalesPeople";
IEdmFunctionImport expectedEdmElement = GetModel().EntityContainers().First().FunctionImports().SingleOrDefault(p => p.Name == "GetSalesPeople");
IEdmEntitySet expectedSet = GetModel().EntityContainers().First().EntitySets().SingleOrDefault(e => e.Name == "Customers");
IEdmType expectedType = expectedEdmElement.ReturnType.Definition;
Uri uri = new Uri(testUrl);
Uri baseUri = new Uri("http://myservice/");

// Acth
ODataPathSegment segment = GetParser().Parse(uri, baseUri, GetModel());

....
Comments: I misunderstood the design so closing it.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>