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

Closed Issue: Url.Action overloads (and similar) ignore inherited properties [1658]

$
0
0
In MVC4, Url.Action (and similar functions) that take an 'object' of route values would construct a route value dictionary directly and rely on the logic inside the RouteValueDictionary class to construct the set of properties and values.

In MVC5 we attempted to optimize this code path by using a cached reflection system - this has the side-effect of ignoring inherited properties and ignoring the TypeDescriptor - which is used by RouteValueDictionary


Expected:
~/?Bar=cool&Foo=Uncool

Actual:
~/?Bar=cool

'''
public class HomeController : Controller
{
//
// GET: /Home/
[Route("")]
public string Index()
{
return Url.Action("Index", "Home", new D() { Bar = "cool", Foo = "Uncool" });
}

private class D : B
{
public string Bar { get; set; }
}

private class B
{
public string Foo { get; set; }
}
}
}
'''
Comments: Verified.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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