Entity Framework Core 2.x Update Dbset not working - ef-core-2.0

I have tried
dbSet.Update(_member)
which duplicates the entry, and
dbSet.Attach(_member)
which ends up in an exception.
In EF Core 1.6, it works without any issue, I had created an extension for AddOrUpdate which works fine in 1.6, but not in 2.x

Related

entity data model wizard crashes with oracle connection

When trying to create model with entity frameowrk database first method, the entity data model wizard crashes. I am trying to connect to oracle database.
Oracle.ManagedDataAccess version :19.6
Oracle.ManagedDataAccess.EntityFramework version : 19.6
ODAC Version 18.3
Entity Framework Version:6.0
Image has been attached for refernce. Process after process mentioned in the image is crashing.
The rule still applies today. ODT Version must match the version of oracle.manageddataaccess and oracle.manageddataacess.entityframework obtained by nuget. It is very tempting to update thru nuget to a later version, but ODT will than crash.
I often have a parallel project to generate my code first model and than copy the files to my model project.
I'm using:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Microsoft ASP.NET MVC 5, NET.Framework 4.6.1
It was happening the same error in my project, I was tryng to use EnityFramework and Oracle Manage Data Access most recent versions. When downgrade the fallowing versions. It start to working without any errors
Versions that worked for me:
EntityFramework 6.1.3
Oracle.ManagedDataAcces 12.2.20230118
Oracle.ManagedDataAcces.EntityFramework 12.2.20230118
The EntityFramework 6.4.4 worked to... But every time I try to scaffold a Entity from the database, It autommatically downgrade to version 6.1.3

Can I use Microsoft.AspNet.Identity on .net core 3.0

I'm working on porting an ASP.NET MVC application to an ASP.NET Core MVC hosted in .NET Core.
I was excited to see that EF 6.3 can host on .NET Core, since it looks like the EF -> EF Core migration is something that I'd at like to defer (possibly indefinitely).
Looking at Microsoft.AspNet.Identity.* nuget packages, it appears that they don't have dependencies on a particular .NET framework (full or Core) just on Entity Framework 6.1 or greater.
Other than the purist idea that I should just move everything over to core while I'm in the code, is there any reason I can't have an ASP.NET Core MVC application that uses EF 6.3 and Microsoft.AspNet.Identity rather than EF Core and Microsoft.AspNetCore.Identity?
After some experimentation:
It looks like I was wrong and Microsoft.AspNet.Identity.Owin has a dependency on the full .NET framework. So I will revise the question:
Can I use Microsoft.AspNetCore.Identity with Entity Framework 6.3? My key goal here is to avoid biting off the EF -> EF Core migration while getting the rest of my codebase moved to .NET Core.

AspNetZero - .NET Core 2.0 MVC Version - Error on adding new controller

After about 6 months, I returned to work on my AspNetZero solution based on .NET Core 2.0.
I have the original downloaded version and the modified version as separate GIT repositories. In both versions/repositories when I try to add a new MVC controller, I keep getting the below error message.
On my PC I have all of the .NET Core SDKs installed from 1.0 right up to 2.1.302. I have other projects that I am working on, where I'm using .NET Core 2.1.
I even created a brand new .NET Core 2.0 project in VS2017 and I am able to scaffold a new MVC controller without any errors. This issue is only happening on the AspNetZero solution.
I have done many searches for a solution and none of the answers I found online have worked. I just added a global.json file into my solution folder and set the SDK to 2.0.0 and tried again, still does not work. I keep getting the same error!
Your NuGet packages may have been invalid according to your
target framework. Check all your recent NuGet packages for .NET Core
versions.
Clear your NuGet cache as shown in the picture
Update: Delete all bin & obj folders.

Updating EF 4.6 edmx model in VS 2015

We have a legacy EF 4.6 project not yet migrated to a newer version of EF.
Now I want to update the model from the database (add a new table) so I open the EDMX in the designer like in VS 2010 and choose "Update from the database". This gives me a warning that "Your project references an older version of Entity Framework. ..."
The only choice in this update from the database action it gives me is EF 5.0 but I need EF 4.6
Is it possible somehow to make the model update in the designer without upgrading to a newer version of EF or using an older version of VS?
I have just come up against the same problem (although I was stuck on v4.0.0.0). The solution was to install ADO.NET Entity Framework 4.1.
This put the required tooling on my computer and allowed me to update my model.

ASP.NET-5 with EF6

Is it possible to use the new ASP.NET with Entity Framework 6 instead of Entity Framework v7?
I use the latest Visual Studio 2015 and could not add a Ado.Net Data Model but the Reference to EF6 was added.
Most existing packages, such as EF6, will not support asp.net Core 5; because of the significant differences, they need to be manually updated. If you're wanting to use EF6 you'll need to stick to asp.net 5 (not Core).
I've run into a series of issues running the EF6 package manager commands, such as Add-Migration, in VS2015 CTP6; I believe they're still working on updates. I was able to get them working in a .Net 4.5 library that is referenced by my .Net 5 libraries, but I've found that occasionally I have to uninstall and install EF6 again to get the package manager commands working.

Resources