// Create new instance of the link for the new resource type. internal override ActionLink CreateCopyFor <TNewResourceType>() { var newResourceLink = new ActionTemplateLink(); CopyTo <TNewResourceType>(newResourceLink); return(newResourceLink); }
// Called for action link containing information based on an expression, specified at compile time, selecting a // controller's action method for which its corresponding URL templated is used. For this type of link, the // consumer is responsible for specifying the route parameter values. private Link SetLinkUrl(ResourceContext context, ActionTemplateLink actionLink) { var apiAction = context.ApiMetadata.GetApiAction( actionLink.GroupTemplateName, actionLink.ActionTemplateName); var link = new Link { Href = apiAction.RelativePath, Methods = new[] { apiAction.HttpMethod } }; MarkOptionalParams(apiAction, link); UpdateLinkDescriptorsAndResource(context, actionLink, link); return(link); }