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

Detect WebAPI2 RouteAttribute and use its route name if found #35

Conversation

MatthewRichards
Copy link
Contributor

See issue #30

This isn't a complete solution - more work required to tidy up, add tests, etc. However I wanted to discuss the approach before going further.

Currently Hyprlinkr doesn't require WebAPI2 / .NET 4.5. Hence we can't use the WebAPI2 RouteAttribute directly. There's a workaround - I've tested that this pull request does the job. But it's not terribly nice having to use reflection for everything.

Options I can see:

  1. This, suitably tidied up (and with enough protection against injection of other classes named System.Web.Http.RouteAttribute!)
  2. A separate library containing an IRouteDispatcher for WebAPI2. This would then require explicit wiring up when people create their RouteLinker.
  3. A separate build of Hyprlinkr for WebAPI2. I assume this isn't really an option because it'd complicate code management a lot.

Any thoughts on how comfortable you'd be with something based on this pull request? If not then I suspect option 2 would be the way to go.

@ploeh
Copy link
Owner

ploeh commented Feb 24, 2015

Thank you for submitting this pull request.

Right now, I'm extraordinarily busy, so may first have time to look at this next week 😓

@ploeh
Copy link
Owner

ploeh commented Feb 26, 2015

There's a fourth options, and that's to upgrade Hyprlinkr to Web API 2. Since I don't know how many people use it, or how they use it, I've created this online poll to figure out whether that'd be a good idea.

Please vote and share 😃

@MatthewRichards
Copy link
Contributor Author

I gather ASP.NET vNext (now 5.0) will unify Web API and MVC (http://www.asp.net/vnext/overview/aspnet-vnext/create-a-web-api-with-mvc-6) - I haven't looked into whether this will mean any changes that are significant to Hyprlinkr, but it does mean Web API 1 will soon be one version further out of date - perhaps an additional argument for going with the upgrade!

@ploeh
Copy link
Owner

ploeh commented Mar 10, 2015

OK, the poll is over, and no-one objects to upgrading Hyprlinkr to Web API 2.

This would mean a new major release of Hyprlinkr (Hyprlinkr 2.0), so that needs to happen first. Would you like to get the 'honour' of doing that, or would you rather prefer that I do it?

@MatthewRichards
Copy link
Contributor Author

Seems conclusive!

I would be up for giving it a go, but might not be very prompt (and might need to call on you for advice if the best approach isn't obvious!). So it depends whether this is something you'd want to get a move on with, and indeed whether you'd have time to be any more prompt!

@ploeh
Copy link
Owner

ploeh commented Mar 11, 2015

@MatthewRichards, I'm in no hurry, so I'm happy to wait if you want to give it a go 😄

@MatthewRichards
Copy link
Contributor Author

Closing this PR in favour of #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants