-
Notifications
You must be signed in to change notification settings - Fork 12
Partial UriTemplate Support #5
Description
Related from here: JakeGinnivan/WebApi.Hal#46
I'm currently working around this by using string concatenation but would like a more elegant solution.
Currently, when you specify a link as a template like this:
~/users/{userid}/friends/{friendid}/interactions
... and then, in the UserRepresentation, where i know the value for the {userid} but not for the {friendid}, i want to return the above link, i need to call:
Links.Add(LinkTemplates.Users.InteractionList.CreateLink(new {userid = 1}));
As a result my url will become:
/users/1/friends//interactions
What i would like in this case, is that the Link class, and the backing UriTemplate class would return a new Link instance, which is still a template, having the following href: ~/users/1/friends/{friendid}/interactions
In my use-case, the value for {friendid}, is known only to the consumer. I do not have these values in my backing data store. I actually would like to return a templated link to my clients.