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
IJsonApiOptionsloggerFactory
ILoggerFactory
Methods
Add(DbContext)
public ResourceGraphBuilder Add(DbContext dbContext)
Parameters
dbContext
DbContext
Returns
Add(Type, Type?, string?)
Adds a JSON:API resource.
public ResourceGraphBuilder Add(Type resourceClrType, Type? idClrType = null, string? publicName = null)
Parameters
resourceClrType
TypeThe resource CLR type.
idClrType
TypeThe resource identifier CLR type.
publicName
stringThe 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
Add<TResource, TId>(string?)
Adds a JSON:API resource.
public ResourceGraphBuilder Add<TResource, TId>(string? publicName = null) where TResource : class, IIdentifiable<TId>
Parameters
publicName
stringThe 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
Type Parameters
TResource
The resource CLR type.
TId
The resource identifier CLR type.
Build()
Constructs the ResourceGraph.
public IResourceGraph Build()