Class ServiceCollectionEntityFrameworkCoreExtensions
Contains Entity Framework Core extension methods for IServiceCollection.
Inheritance
System.Object
ServiceCollectionEntityFrameworkCoreExtensions
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.EntityFrameworkCore.dll
Syntax
public static class ServiceCollectionEntityFrameworkCoreExtensions
Methods
| Improve this Doc View SourceReplaceDbContext(IServiceCollection)
Replaces the registered Microsoft.EntityFrameworkCore.DbContext with an in memory scoped implementation.
Declaration
public static IServiceCollection ReplaceDbContext(this IServiceCollection serviceCollection)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Extensions.DependencyInjection.IServiceCollection | serviceCollection | Instance of IServiceCollection type. |
Returns
| Type | Description |
|---|---|
| Microsoft.Extensions.DependencyInjection.IServiceCollection | The same IServiceCollection. |