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

Partial UriTemplate Support #5

@danbarua

Description

@danbarua

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions