Frage

I'm trying to use T4MVC to create strongly typed links to WebApi endpoints, and while it does generate helpers for my ApiControllers, there's no method for creating links. The generated controllers have ViewNames, but no action methods. I guess this is because ApiController's don't return ActionResult's, but what do I need to be doing instead to create these links?

War es hilfreich?

Lösung

It is not supported today, but please check out this thread which has some good amount of discussion about it. Feel free to reply over there to add to it.

Andere Tipps

Still doesn't seem to be supported by the end of 2015.

If it's URL generation that you're concerned with, then take a look at Drum if you're using attribute routing in Web.API 2+. And if you've got routes set up in your application startup (Web.API 1) then it appears Hyperlinkr will be helpful.

If you need other things (like a hard-coded parameter list) then you're still out of luck.

Disclaimer: I've not used either

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top