Closed
Description
Should be able to disable relational link navigation.
Probably include a param in the relational attribute constructor:
public class Item : Identifiable
{
[HasOne("owner", Link.None)]
public virtual Person Owner { get; set; }
public int OwnerId { get; set; }
}
May also disable links per resource, at the document level:
[Links(Link.None)]
public class Item : Identifiable
{
// ...
}
And globally:
public IServiceProvider ConfigureServices(IServiceCollection services) {
services.AddJsonApi<DbContext>(
opt.BuildContextGraph(builder => {
builder.DocumentLinks = Links.Self | Links.Paging;
});
// ...
}
Possible flags:
[Flags]
public enum Links
{
None = 0,
Self = 1 << 0,
Paging = 1 << 1,
Related = 1 << 2,
All = ~(-1 << 3)
}