本文整理汇总了C#中RouteCollection.MapAttributeRoutesInAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapAttributeRoutesInAssembly方法的具体用法?C# RouteCollection.MapAttributeRoutesInAssembly怎么用?C# RouteCollection.MapAttributeRoutesInAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.MapAttributeRoutesInAssembly方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
RouteAssert.UseAssertEngine(new NunitAssertEngine());
routes = new RouteCollection();
routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController));
}
示例2: ArticlesMvcRouteTest
public ArticlesMvcRouteTest()
{
//// Arrange
testRoutes = new RouteCollection();
testRoutes.MapAttributeRoutesInAssembly(typeof(ArticlesController));
RouteConfig.RegisterRoutes(testRoutes);
}
示例3: CreateUrlHelper
public static UrlHelper CreateUrlHelper()
{
var context = new Mock<HttpContextBase>();
var request = new Mock<HttpRequestBase>();
var response = new Mock<HttpResponseBase>();
var session = new Mock<HttpSessionStateBase>();
var server = new Mock<HttpServerUtilityBase>();
context.Setup(ctx => ctx.Request).Returns(request.Object);
context.Setup(ctx => ctx.Response).Returns(response.Object);
context.Setup(ctx => ctx.Session).Returns(session.Object);
context.Setup(ctx => ctx.Server).Returns(server.Object);
request.SetupGet(x => x.ApplicationPath).Returns("/");
request.SetupGet(x => x.Url).Returns(new Uri("http://localhost/a", UriKind.Absolute));
request.SetupGet(x => x.ServerVariables).Returns(new NameValueCollection());
response.Setup(x => x.ApplyAppPathModifier(It.IsAny<string>())).Returns<string>(x => x);
context.SetupGet(x => x.Request).Returns(request.Object);
context.SetupGet(x => x.Response).Returns(response.Object);
var routes = new RouteCollection();
routes.MapAttributeRoutesInAssembly(typeof(HomeController).Assembly);
return new UrlHelper(new RequestContext(context.Object, new RouteData()), routes);
}
示例4: Setup
public void Setup()
{
var defaultConstraintResolver = new DefaultInlineConstraintResolver();
defaultConstraintResolver.ConstraintMap.Add("verb", typeof(CustomConstraint));
routes = new RouteCollection();
routes.MapAttributeRoutesInAssembly(typeof(WithAreaController).Assembly, defaultConstraintResolver);
}
示例5: Setup
public void Setup()
{
assertEngine = new FakeAssertEngine();
RouteAssert.UseAssertEngine(assertEngine);
routes = new RouteCollection();
routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController));
}
示例6: Setup
public void Setup()
{
RouteAssert.UseAssertEngine(new NunitAssertEngine());
var defaultConstraintResolver = new DefaultInlineConstraintResolver();
defaultConstraintResolver.ConstraintMap.Add("verb", typeof(CustomConstraint));
routes = new RouteCollection();
routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController), defaultConstraintResolver);
}
示例7: Setup
public void Setup()
{
routes = new RouteCollection();
routes.MapAttributeRoutesInAssembly(typeof(WithAreaController).Assembly);
}
示例8: Setup
public void Setup()
{
routes = new RouteCollection();
routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController));
}