Open smolesen opened 11 years ago
Need more details on the context
On Mar 14, 2013, at 4:18 AM, smolesen notifications@github.com wrote:
Just upgraded to AR 3.5.6.0, and now the following code starts to fail:
var convention = type.GetCustomAttribute(true); var routeAreaAttribute = type.GetCustomAttribute(true) ?? convention.SafeGet(x => x.GetDefaultRouteArea(type));
(can't remember where I got it from)
is there another way to do this now?
TIA
/Søren
— Reply to this email directly or view it on GitHubhttps://github.com/mccalltd/AttributeRouting/issues/221 .
Think some of the code got lost when pasting... I've changed it to var convention = type.GetCustomAttribute<RouteConventionAttributeBase>(true); var routeAreaAttribute = type.GetCustomAttribute<RouteAreaAttribute>(true); if (routeAreaAttribute == null && convention != null) routeAreaAttribute = convention.SafeGet(x => x.GetDefaultRouteArea(type));
and now it's working... seems like convention.SafeGet(x => x.GetDefaultRouteArea(type)) would return null in previous version, whereas it now throws an exception....
Just upgraded to AR 3.5.6.0, and now the following code starts to fail:
var convention = type.GetCustomAttribute(true);
var routeAreaAttribute = type.GetCustomAttribute(true) ?? convention.SafeGet(x => x.GetDefaultRouteArea(type));
(can't remember where I got it from)
is there another way to do this now?
TIA
/Søren