-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Currently it is required to register a custom version of ILinkHelper in startup.
Maybe it is possible to configure AspNet.HypermediaApi Linking with a helper, something like:
public void ConfigureServices(IServiceCollection services)
{
services.AddHypermediaApi(new AddHypermediaApiOptions() {
GenerateToHomeAccountLink = (linkHelper, httpContext) => {
var username = httpContext?.User?.Identity?.Name;
return
username == null ? linkHelper.ToAction<HomeController>(x => x.AccountHome(TemplateParameter.Create<string>()))
: linkHelper.ToAction<HomeController>(x => x.AccountHome(username));
}
});Metadata
Metadata
Assignees
Labels
No labels