本文整理汇总了C#中IMapper.Resources方法的典型用法代码示例。如果您正苦于以下问题:C# IMapper.Resources方法的具体用法?C# IMapper.Resources怎么用?C# IMapper.Resources使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMapper
的用法示例。
在下文中一共展示了IMapper.Resources方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Root<HomeController>(h => h.Index());
map.Resources<AnimalsController>();
map.Resources<KeepersController>();
map.Resources<EnclosuresController>();
}
示例2: Map
public override void Map(IMapper map)
{
map.Root<HomeController>(x => x.Index());
map.Resources<BlogsController>(blogs =>
{
blogs.Resources<PostsController>();
});
map.Resources<GalleriesController>();
}
示例3: Map
public override void Map(IMapper map)
{
#if DEBUG
map.DebugRoute("routedebug");
#endif
map.Root<HomeController>(x => x.Index());
map.Resource<HomeController>(home =>
{
home.Only();
});
map.Resources<WikiController>(wiki =>
{
wiki.As("wiki");
wiki.Only("index", "show");
});
map.Resources<TestAgentsController>(agents =>
{
agents.As("agents");
agents.Only("index", "show");
});
map.Resources<TestProjectsController>(projects =>
{
projects.As("projects");
projects.Resources<TestBuildsController>(builds =>
{
builds.As("builds");
builds.Only("index", "new", "create");
});
projects.Resources<TestPlansController>(plans =>
{
plans.As("plans");
});
projects.Resources<TestSessionsController>(sessions =>
{
sessions.As("sessions");
sessions.Member(z => z.Post("restart"));
sessions.Member(z => z.Post("continue"));
});
});
}
示例4: Map
public override void Map(IMapper map)
{
if (HttpContext.Current != null && HttpContext.Current.IsDebuggingEnabled)
{
map.DebugRoute(RouteDiagnosticsVirtualPath);
}
map.Root<HomeController>(c => c.Index());
map.Resources<BragController>(c => c.Only("new", "create"));
// use the standard restful routes for managing runtime Sessions:
map.Resource<SessionController>(c => c.Only("create", "new", "destroy"));
// add human-friendly shortcuts for logging in and out:
map.Path("login").GetOnly().To<SessionController>(c => c.New());
map.Path("logout").GetOnly().To<HomeController>(c => c.Logout());
// add a path to the OUr Services page
map.Path("ourservice").GetOnly().To<HomeController>(c => c.OurService());
map.Path("admin").GetOnly().To<HomeController>(c => c.Admin());
// HACK: add a standard MVC pattern-matching route limited
// to the PartialController to support calls like:
// Html.RenderAction("login", "partial");
map.Route(new Route("partial/{action}",
new RouteValueDictionary(new {controller = "partial"}),
new MvcRouteHandler()));
}
示例5: Map
public override void Map(IMapper map)
{
// ReSharper disable ConvertToLambdaExpression
map.Root<HomeController>(x => x.Index());
map.Resources<PostsController>(posts => {
posts.Collection(x => {
x.Get("search");
x.Post("search");
});
});
map.Resources<AccountsController>(accounts => {
accounts.As("users");
accounts.Member(x => x.Post("update"));
});
// ReSharper restore ConvertToLambdaExpression
}
示例6: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Root<CommentsController>(c => c.Index(null));
map.Resources<CommentsController>(c => c.Only("index", "new", "create"));
map.Resource<ContactController>(c => c.Only("new", "create"));
map.Resource<ErrorController>(e => e.Only("show"));
/*
* Note: You can register and next resources
*
map.Root<HomeController>(x => x.Index());
map.Resources<BlogsController>(blogs =>
{
blogs.As("weblogs");
blogs.Only("index", "show");
blogs.Collection(x => x.Get("latest"));
blogs.Resources<PostsController>(posts =>
{
posts.Except("create", "update", "destroy");
posts.Resources<CommentsController>(c => c.Except("destroy"));
});
});
map.Area<Controllers.Admin.BlogsController>("admin", admin =>
{
admin.Resources<Controllers.Admin.BlogsController>();
admin.Resources<Controllers.Admin.PostsController>();
});
*/
}
示例7: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Root<HomeController>(x => x.Index());
map.Resources<PageNewsController>(x => x.Only("Index"));
}
示例8: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Root<MoviesController>(r => r.Index());
map.Resources<MoviesController>(r => r.Except("Show", "Edit", "Update"));
}
示例9: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Root<CategoryController>(c => c.Index("/"));
map.Resources<UserController>();
map.Resources<ReportController>(c => c.Member(x => x.Get("Search")));
map.Resources<ReportParameterController>(reportParameter => reportParameter.Only("Index"));
map.Resources<CategoryController>(category => category.Only("Index"));
map.Resources<ClientController>(client => client.Only("Index"));
map.Resources<RoleController>(r => r.WithFormatRoutes());
map.Resource<FileController>(file => file.Only("Create"));
map.Resource<SearchController>(s => s.Only("New", "Create"));
map.Resources<AccountController>(
account =>
{
account.Except("new", "create", "show", "index", "update", "destroy");
account.Collection(x => x.Get("Login"));
account.Collection(x => x.Post("Login"));
account.Collection(x => x.Get("Register"));
account.Collection(x => x.Post("Register"));
account.Collection(x => x.Put("Confirm"));
});
}
示例10: Map
public override void Map(IMapper map)
{
map.Root<RootController>(x => x.Index());
map.Resources<TodosController>(mapper => {
// Manually need to add a GET /todos/id/delete route not out-of-the-box
mapper.Member(action => action.Get("delete"));
mapper.WithFormatRoutes();
});
}
示例11: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Root<HomeController>(x => x.Index());
map.Resources<UsersController>(users =>
users.Resources<ShelvesController>()
);
map.Resources<ShelvesController>(shelves => {
shelves.Resources<BooksController>();
shelves.Resources<UsersController>();
});
map.Resources<BooksController>(books => {
books.Resources<AuthorsController>();
books.Resources<ShelvesController>();
});
map.Resources<AuthorsController>(authors =>
authors.Resources<BooksController>()
);
}
示例12: Map
public override void Map(IMapper map)
{
// Additional delete mapping.
MapDelete = true;
map.DebugRoute("routedebug");
// Mapped the index
map.Root<HomeController>(x => x.Index());
// Mapping the resource, but I only want an index.
// map.Resource<ProductsController>(p => { p.Only("index"); p.As("products"); }); // ERROR and no index in the RouteDebug...
// Mapping the resource, just give me everything.
map.Resources<ProductsController>(p => p.As("products")); // NO ERROR, But also no index in the RouteDebug...
// Created a seperate set.
map.Connect<AdminRouteSet>();
}
示例13: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Root<HomeController>(x => x.Index());
map.Resources<QuotesController>();
map.Resources<CategoriesController>();
map.Resources<AuthorsController>();
map.Resources<MenusController>();
map.Resources<UserQuotesController>(uq =>
{
uq.As("user-quotes");
uq.Only("create");
});
map.Resources<LiveQuotesController>(l =>
{
l.As("live");
l.Only("index");
});
}
示例14: Map
public override void Map(IMapper map)
{
map.DebugRoute("routedebug");
map.Resources<UsersController>(u => { u.Only("create"); });
map.Root<HomeController>(x => x.Index());
}
示例15: Map
public override void Map(IMapper map)
{
map.Resources<PostsController>();
}