You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the configuration.AddRoutesFromAssembly method it does not seem RoutePrefix or RouteArea attributes are observed. See below sample code/test:
[RouteArea("Fakes")]
[RoutePrefix("FakeItems")]
public class FakeItemsController : Controller {
[GET("Index")]
public ActionResult Index() {
return null;
}
}
[TestClass]
public class AttributeRoutingTests {
[TestMethod]
public void MapAttributeRoutes_SpecifyAssemblyInConfiguration_RoutePrefixInUrl() {
// Arrange
var routes = new RouteCollection();
// Act
routes.MapAttributeRoutes(config => {
config.AddRoutesFromAssembly(typeof(FakeItemsController).Assembly);
});
// Assert
Console.WriteLine(String.Format("{0} routes registered.",
routes.Count()));
foreach (var route in routes.Cast<Route>()) {
Console.WriteLine(route.Url);
}
Assert.IsTrue(routes.Any(r => ((Route)r).Url == "Fakes/FakeItems/Index"));
}
}
The text was updated successfully, but these errors were encountered:
When using the configuration.AddRoutesFromAssembly method it does not seem RoutePrefix or RouteArea attributes are observed. See below sample code/test:
The text was updated successfully, but these errors were encountered: