DbContextOptionsBuilderServiceHelper Class
Namespace: PTS
Assembly: PTS.EntityLayer.Extensibility.dll
Dependency injection extension methods for Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
Syntax
public static class DbContextOptionsBuilderServiceHelper
Inheritance
System.Object
DbContextOptionsBuilderServiceHelper
Methods
AddService<TService>(DbContextOptionsBuilder)
Declaration
public static DbContextOptionsBuilder AddService<TService>(this DbContextOptionsBuilder optionsBuilder)
where TService : class
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.EntityFrameworkCore.DbContextOptionsBuilder | optionsBuilder |
Returns
| Type | Description |
|---|---|
| Microsoft.EntityFrameworkCore.DbContextOptionsBuilder |
Type Parameters
| Name | Description |
|---|---|
| TService |
AddService<TService>(DbContextOptionsBuilder, Func<IServiceProvider, TService>)
Declaration
public static DbContextOptionsBuilder AddService<TService>(this DbContextOptionsBuilder optionsBuilder, Func<IServiceProvider, TService> implementationFactory)
where TService : class
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.EntityFrameworkCore.DbContextOptionsBuilder | optionsBuilder | |
| System.Func<System.IServiceProvider, TService> | implementationFactory |
Returns
| Type | Description |
|---|---|
| Microsoft.EntityFrameworkCore.DbContextOptionsBuilder |
Type Parameters
| Name | Description |
|---|---|
| TService |
AddService<TService, TImplementation>(DbContextOptionsBuilder)
Adds service that will be injected into service scope of ExtensibleDbContext
Declaration
public static DbContextOptionsBuilder AddService<TService, TImplementation>(this DbContextOptionsBuilder optionsBuilder)
where TService : class where TImplementation : class, TService
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.EntityFrameworkCore.DbContextOptionsBuilder | optionsBuilder | A reference to this instance after the operation has completed. |
Returns
| Type | Description |
|---|---|
| Microsoft.EntityFrameworkCore.DbContextOptionsBuilder |
Type Parameters
| Name | Description |
|---|---|
| TService | The type of the service to add. |
| TImplementation | The type of the implementation to use. |
TryAddExtension<TExtension>(DbContextOptionsBuilder)
Allocates specified exension type.
Declaration
public static TExtension TryAddExtension<TExtension>(this DbContextOptionsBuilder optionsBuilder)
where TExtension : class, IDbContextOptionsExtension, new()
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.EntityFrameworkCore.DbContextOptionsBuilder | optionsBuilder | Options builder to add the extension to. |
Returns
| Type | Description |
|---|---|
| TExtension | Initialized extension instance. |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of the extension. |
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()