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
optionsIJsonApiOptionsloggerFactoryILoggerFactory
Methods
Add(DbContext)
public ResourceGraphBuilder Add(DbContext dbContext)
Parameters
dbContextDbContext
Returns
Add(Type, Type?, string?)
Adds a JSON:API resource.
public ResourceGraphBuilder Add(Type resourceClrType, Type? idClrType = null, string? publicName = null)
Parameters
resourceClrTypeTypeThe resource CLR type.
idClrTypeTypeThe resource identifier CLR type.
publicNamestringThe 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
publicNamestringThe 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
TResourceThe resource CLR type.
TIdThe resource identifier CLR type.
Build()
Constructs the ResourceGraph.
public IResourceGraph Build()
Returns
Remove(Type)
Removes a JSON:API resource.
public ResourceGraphBuilder Remove(Type resourceClrType)
Parameters
resourceClrTypeTypeThe resource CLR type.
Returns
Remove<TResource>()
Removes a JSON:API resource.
public ResourceGraphBuilder Remove<TResource>() where TResource : class, IIdentifiable
Returns
Type Parameters
TResourceThe resource CLR type.