-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A default DbContext context must exist, or a context factory must be provided (EntityFrameworkManager.ContextFactory). This setting is required for some additional features #47
Comments
Hello Joel, Currently, we do not support PostgreSQL for the EF Core version. We will try to add the support during the weekend since almost everything is already here. About the error, it's caused because there is no default constructor for your context. For EF Core, we modified a little bit our code and it must require now to be able to create a context. Example: static ApplicationDbContextPCore()
{
var options = new DbContextOptionsBuilder();
options.UseNpgsql(new SqlConnection(My.Config.ConnectionStrings.TestDatabase));
EntityFrameworkManager.ContextFactory = context => new ApplicationDbContextPCore(options);
} We will try to document and improve the error message as well. More information will be provided as soon as we support it. Best Regards, Jonathan |
Alright! Thank you for the answer, looking forward for an updated version then :) |
Hello @joelnotified , We finally success to release our stable version which supports PostgreSQL ;) https://www.nuget.org/packages/Z.EntityFramework.Extensions.EFCore/ Let me know if you found some issue. Best Regards, Jonathan |
Closing Comment: Fix released |
|
Hi!
I'm trying to use
BulkSaveChangesAsync
together with EF Core (and Postgresql if that makes any difference) in an ASP.NET Core project.I get the following error:
A default DbContext context must exist, or a context factory must be provided (EntityFrameworkManager.ContextFactory). This setting is required for some additional features
This is the package I use:
<PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="0.0.1-beta5" />
I have configured EF like this:
I do not really understand the error message, how should I configure a default DbContext (as you can see I have multiple contexts). Or where should I provide the context factory?
Thank you!
The text was updated successfully, but these errors were encountered: