zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

14 results in tag: autofac

How to inject EntityFramework Core DbContext in Repository

Most of the examples online deal with asp.net and register their DbContext as part of their startup service registry....I tried registering my DbContext like this...builder.RegisterType<MyContext>() .As<MyContext>() .InstancePerLifetimeScope(); b...
autofac botframework c# entity-framework entity-framework-core
asked by martinni39

Cannot use EF Core Migration

I am using EF Core code first in a window service with Autofac DI and when I run Add-Migration TestDD1InitialMigration I get error...No parameterless constructor was found on 'ClientsContext'. Either add a parameterless constructor to 'ClientsContext' or ...
.net autofac c# entity-framework entity-framework-core
asked by pantonis

.NET Core (MYSQL) Generic Repository AutoWiring using Autofac

What I'm aiming to achieve is the following. I'm trying to setup a new solution using: MySQL, .NET Core, Autofac, EF Core... making use of the (generic) repository pattern....Ultimately I'll be jumping onto a project with an existing db, thus my aim is to...
.net-core autofac c# entity-framework-core ioc-container
asked by Rohan Büchner

Autofac Multitenant Database Configuration

I have a base abstract context which has a couple hundred shared objects, and then 2 "implementation" contexts which both inherit from the base and are designed to be used by different tenants in a .net core application. A tenant object is injected into ...
asp.net-core autofac entity-framework-core multi-tenant
asked by Dan

Huge memory Consumption (MVC 5 + EntityFramework 6.2.0 )

I am having some concerns about my project using a lot of memory. I have configured my MVC 5 project with Entity Framework. I also use Autofac. ...I locate my repository classes and service classes (which are in the same project) by doing:...builder.Regis...
autofac c# entity-framework entity-framework-6
asked by user9647280

NopCommerce 4.10 error while installing plugin

Hi have been following the ...Pluralsight... Course on NopCommerce, but it is for the older version. ...I have been trying to build the same functionality in NopCommerce 4.10...When I try to install the plugin, getting the error: ...No constructor was fou...
autofac c# entity-framework-core nopcommerce nopcommerce-4.1
asked by Kinder Cappy

Autofac - Retrieving new instance of UnitOfWork - "DBcontext has been disposed error"

I have a batch job which is parsing a CSV file and creating and processing records. At each row, I have to perform commits as I need to create entities and then use the results of the created entities. ...As there is thousands of records, the performance ...
autofac c# entity-framework entity-framework-6
asked by Ciaran Gallagher

Callback on SaveChanges in EFCore?

I'm trying to do something like in my ...DbContext...:...public System.Action<IEnumerable<EntityEntry>> OnSave; public override int SaveChanges() { if(OnSave != null) OnSave(ChangeTracker.Entries()); return base.SaveChanges(); } ...Then...
asp.net-core autofac c# dbcontext entity-framework-core
asked by tweetypi

Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'myContext' to type DataContext. error in Azure Function v2

Requirement: Create Azure Function which can inject ...Entity Framework... context to ...Run... method using dependency injection....Here is my ...Startup... class... [assembly: WebJobsStartup(typeof(Startup))] namespace MessagesToSqlDbFuncApp {...
autofac azure azure-functions c# entity-framework-core
asked by kudlatiger

Injecting Connection String from config file into EF Core DbContext

I have a need to inject a dependency into my DbContext Class for my project. I am trying to do this in a way that follows "Clean Architecture". ...I need to be able to use the DbContext's empty constructor and still reference the connection string from a...
autofac c# clean-architecture entity-framework-core property-injection
asked by Zach Painter

Repository pattern with multiple databases

I am using repository pattern on EF Core and Autofac in a windows service....I have a service that needs to connect with the some dozen databases which have the same schema (same dbcontext) but only different data. How can I achieve this in my service us...
.net .net-core autofac c# entity-framework-core
asked by pantonis

No service for type 'IServiceProviderFactory[Autofac.ContainerBuilder]' has been registered

When running the following command to add database migration script, I get the following error: ...dotnet ef migrations add InitialCreate -v -o .\Migrations\ --context MyContext ...An error occurred while accessing the Microsoft.Extensions.Hosting service...
asp.net-core autofac c# entity-framework-core
asked by Hamed

How to execute database migrations on startup when using Autofac.AspNetCore.Multitenant in .NET Core 3.x?

In single-tenanted .NET Core apps, EF Core database migrations (and DB seeding) can be executed immediately after the IHost has been built (typically in Program.cs):...await BuildHost(args) .MigrateDbContext<I.MyDbContext>() .RunAsync(); } ...sinc...
asp.net-core-3.0 autofac database-migration entity-framework-core multi-tenant
asked by Richard Urwin

Custom model building for EF Core

I have a model that I want to load one of its columns from a source other than the database behind EF Core for example MongoDb....The problem is that I can't figure how to override query execution in EF Core. For Saves it's OK because EF Core lets us to o...
asp.net-core autofac custom-model-binder entity-framework-core ninject
asked by SSgumS

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!