Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Partial UriTemplate Support #5

Open
danbarua opened this issue Nov 13, 2014 · 1 comment
Open

Partial UriTemplate Support #5

danbarua opened this issue Nov 13, 2014 · 1 comment

Comments

@danbarua
Copy link
Collaborator

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.

@danbarua
Copy link
Collaborator Author

danbarua commented Dec 9, 2014

Tavis.UriTemplates now has support for partial templates: https://github.com/tavis-software/Tavis.UriTemplates#8

@danbarua danbarua changed the title UriTemplate issues Partial UriTemplate Support Dec 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant