Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom links within relation #86

Open
OBrutus opened this issue Oct 17, 2021 · 1 comment
Open

Custom links within relation #86

OBrutus opened this issue Oct 17, 2021 · 1 comment

Comments

@OBrutus
Copy link

OBrutus commented Oct 17, 2021

Hi, I wanted to have my self defined links provided within relationship. It is wired with respect to ID of other relation, but I don't want, I wish to have custom link. So is there is a way to do if yes please share.

@circleupx
Copy link

circleupx commented Oct 19, 2021

@OBrutus

I think you can achieve your goal by building a relationship object.

var relationship = new Relationship
{
    Links = new Links
    {
        Self = "https://www.google.com/"
    }
}

Then use it on a relationship.

using var documentContext = new SomeDocumentContext(requestUri);
                document = documentContext
                        .NewDocument(requestUri)
                            .Links()
                                .AddSelfLink()
                            .LinksEnd()
                            .ResourceCollection(resourceCollection)
                                .Relationships()
                                    .AddRelationship("myCustomRelationship", relationship)
                                .RelationshipsEnd()
                            .Links()
                                .AddSelfLink()
                            .LinksEnd()
                            .ResourceCollectionEnd()
                        .WriteDocument();

Is that what you are looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants