Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route as route value dictionary #27

Open
waynebrantley opened this issue Jan 9, 2017 · 0 comments
Open

Route as route value dictionary #27

waynebrantley opened this issue Jan 9, 2017 · 0 comments
Assignees
Milestone

Comments

@waynebrantley
Copy link

The following extension was necessary for us to write on your system.web version of this library.
You made classes public so that we could do extensions like this in that library.
This is a preemptive attempt at making sure the same kind of classes are now exposed publicly in this library too.

  public static RouteValueDictionary RouteValueDictionary<TController>(
 
               this UrlHelper helper,
 
               Expression<Func<TController, Task>> action,
 
               object routeValues = null)
 
           where TController : Controller
 
        {
 
            var routeInfo = RouteInformation.FromExpression<TController>(action, routeValues);
 
            var dictionary = routeInfo.RouteValueDictionary;
 
            dictionary.Add("controller", routeInfo.ControllerName);
 
            dictionary.Add("action", routeInfo.ActionName);
 
            return dictionary;
 
        }
 

Thanks!!

@ivaylokenov ivaylokenov added this to the Version 2.0.0 milestone Jan 14, 2017
@ivaylokenov ivaylokenov self-assigned this Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants