Skip to content

How to support creating links for sub-collections in the PagedListRepresentation sample? #42

@jasonmitchell

Description

@jasonmitchell

The Hallo.Sample project includes an example PagedListRepresentation<T> which accepts the baseUrl for the collection. Below is the snippet of how this is constructed.

public class PersonListRepresentation : PagedListRepresentation<Person>
{
public PersonListRepresentation(PersonRepresentation personRepresentation)
: base("/people", personRepresentation) { }
}

This works fine for constant base URLs like in this example but is more difficult when the base URL is dynamic. For example, if the URL to the collection was /race/123/cars (where 123 is the resource id) how do we support getting the race id into the base URL?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions