You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 20, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 20, 2020. It is now read-only.
Accessing Root object when creating links in embbedded items #12
To define links in embbedded items frequently is neccessary to have access to parent node info.
For example if we have a "folder" resource with a "self" link [folder], usually each of its items will have a "self" link as [folder]/[item]. To generate each item "self" link it needs all info in its parent object.
What I propose is to use the same
.Links((model, context) =>
,but extending context to not only contain NancyContext, but to be "custom" a HalContext with
public class HalContext
{
public NancyContext NancyContext { get; set; }
public Object Root { get; set; }
}
To mantain compatibiltiy with existing code we could have something like
Of course, have a go at it and send a pull-request if you think this would work.
Take a look at https://github.com/DotNetHypermedia/DotNetHypermedia - lots of us who are using hypermedia and writing hypermedia libraries are looking at how we can collaborate on sharing features and ideas together for a common hypermedia project - so the more ideas we can generate the better.
Activity
danbarua commentedon Nov 25, 2014
Of course, have a go at it and send a pull-request if you think this would work.
Take a look at https://github.com/DotNetHypermedia/DotNetHypermedia - lots of us who are using hypermedia and writing hypermedia libraries are looking at how we can collaborate on sharing features and ideas together for a common hypermedia project - so the more ideas we can generate the better.
danbarua commentedon Nov 25, 2014
In particular, the discussion is in the issues but we're working on spiking rough ideas out in code too https://github.com/DotNetHypermedia/DotNetHypermedia/issues