Table of Contents

Class ResourceGraphBuilder

Namespace
JsonApiDotNetCore.Configuration
Assembly
JsonApiDotNetCore.dll

Builds and configures the ResourceGraph.

[PublicAPI]
public class ResourceGraphBuilder
Inheritance
ResourceGraphBuilder
Inherited Members

Constructors

ResourceGraphBuilder(IJsonApiOptions, ILoggerFactory)

public ResourceGraphBuilder(IJsonApiOptions options, ILoggerFactory loggerFactory)

Parameters

options IJsonApiOptions
loggerFactory ILoggerFactory

Methods

Add(DbContext)

public ResourceGraphBuilder Add(DbContext dbContext)

Parameters

dbContext DbContext

Returns

ResourceGraphBuilder

Add(Type, Type?, string?)

Adds a JSON:API resource.

public ResourceGraphBuilder Add(Type resourceClrType, Type? idClrType = null, string? publicName = null)

Parameters

resourceClrType Type

The resource CLR type.

idClrType Type

The resource identifier CLR type.

publicName string

The name under which the resource is publicly exposed by the API. If nothing is specified, the naming convention is applied on the pluralized CLR type name.

Returns

ResourceGraphBuilder

Add<TResource, TId>(string?)

Adds a JSON:API resource.

public ResourceGraphBuilder Add<TResource, TId>(string? publicName = null) where TResource : class, IIdentifiable<TId>

Parameters

publicName string

The name under which the resource is publicly exposed by the API. If nothing is specified, the naming convention is applied on the pluralized CLR type name.

Returns

ResourceGraphBuilder

Type Parameters

TResource

The resource CLR type.

TId

The resource identifier CLR type.

Build()

Constructs the ResourceGraph.

public IResourceGraph Build()

Returns

IResourceGraph