Table of Contents

Class ServiceCollectionExtensions

Namespace
JsonApiDotNetCore.Configuration
Assembly
JsonApiDotNetCore.dll
[PublicAPI]
public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

AddJsonApi(IServiceCollection, Action<JsonApiOptions>?, Action<ServiceDiscoveryFacade>?, Action<ResourceGraphBuilder>?, IMvcCoreBuilder?, ICollection<Type>?)

Configures JsonApiDotNetCore by registering resources manually.

public static IServiceCollection AddJsonApi(this IServiceCollection services, Action<JsonApiOptions>? options = null, Action<ServiceDiscoveryFacade>? discovery = null, Action<ResourceGraphBuilder>? resources = null, IMvcCoreBuilder? mvcBuilder = null, ICollection<Type>? dbContextTypes = null)

Parameters

services IServiceCollection
options Action<JsonApiOptions>
discovery Action<ServiceDiscoveryFacade>
resources Action<ResourceGraphBuilder>
mvcBuilder IMvcCoreBuilder
dbContextTypes ICollection<Type>

Returns

IServiceCollection

AddJsonApi<TDbContext>(IServiceCollection, Action<JsonApiOptions>?, Action<ServiceDiscoveryFacade>?, Action<ResourceGraphBuilder>?, IMvcCoreBuilder?)

Configures JsonApiDotNetCore by registering resources from an Entity Framework Core model.

public static IServiceCollection AddJsonApi<TDbContext>(this IServiceCollection services, Action<JsonApiOptions>? options = null, Action<ServiceDiscoveryFacade>? discovery = null, Action<ResourceGraphBuilder>? resources = null, IMvcCoreBuilder? mvcBuilder = null) where TDbContext : DbContext

Parameters

services IServiceCollection
options Action<JsonApiOptions>
discovery Action<ServiceDiscoveryFacade>
resources Action<ResourceGraphBuilder>
mvcBuilder IMvcCoreBuilder

Returns

IServiceCollection

Type Parameters

TDbContext

AddResourceDefinition<TResourceDefinition>(IServiceCollection)

Adds IoC container registrations for the various JsonApiDotNetCore resource definition interfaces, such as IResourceDefinition<TResource, TId>.

public static IServiceCollection AddResourceDefinition<TResourceDefinition>(this IServiceCollection services)

Parameters

services IServiceCollection

Returns

IServiceCollection

Type Parameters

TResourceDefinition

AddResourceRepository<TRepository>(IServiceCollection)

Adds IoC container registrations for the various JsonApiDotNetCore resource repository interfaces, such as IResourceReadRepository<TResource, TId> and IResourceWriteRepository<TResource, TId>.

public static IServiceCollection AddResourceRepository<TRepository>(this IServiceCollection services)

Parameters

services IServiceCollection

Returns

IServiceCollection

Type Parameters

TRepository

AddResourceService<TService>(IServiceCollection)

Adds IoC container registrations for the various JsonApiDotNetCore resource service interfaces, such as IGetAllService<TResource, TId>, ICreateService<TResource, TId> and the various others.

public static IServiceCollection AddResourceService<TService>(this IServiceCollection services)

Parameters

services IServiceCollection

Returns

IServiceCollection

Type Parameters

TService