Type Load Exception in EF Core Project
Please update to your entity framework core nuget package to 3.1.10(or latest 5.0.0). It will solve your problem.
Please update to your entity framework core nuget package to 3.1.10(or latest 5.0.0). It will solve your problem.
I solved this problem by: (1) Right clicking the project in the Solution Explorer (2) Clicking unload project (3) Click edit the .csproj and check if there is a Package Reference to EF (4) Right clicking the project again in the Solution Explorer (5) Then clicked reload project Now it recognizes EntityFrameworkCore and there are … Read more
The solution that worked for me after trying a whole raft of other solutions posted, was to: right click on my project select Manage Nuget Packages select the browse tab thick Include prerelease check box install the Microsoft.EntityFrameworkCore.Tools N.b that aspnetcore project in visual studio 2017 do not seem to have the project.json file.
As said in comments by other, you can take EF6 code to parse your expressions and apply the relevant Include/ThenInclude calls. It does not look that hard after all, but as this was not my idea, I would rather not put an answer with the code for it. You may instead change your pattern for … Read more
but I get an ICollection in the last lambda displayed, so I obviously need the Select() No, you don’t. EF Core Include / ThenInclude totally replace the need of Select / SelectMany used in EF6. Both they have separate overloads for collection and reference type navigation properties. If you use the overload with collection, ThenInclude … Read more
Had to install Microsoft.EntityFrameworkCore.Relational to fix the issue. Edit: Credit goes to Ivan Stoev for finding this out
Here is how I would do it in one query based on the information you provided. var posts = await _context.Post .Where(post => _context.BlogPost.Any(bp => bp.BlogId == blogId && bp.PostId == post.PostId) ) .ToListAsync(); Here is how I would do it in two queries in order to use Contains based on the information you provided. … Read more
UPDATE This turned out to be an issue with a lot of facets. Main problem was Visual Studio: https://developercommunity.visualstudio.com/content/problem/438312/vs-2019-preview2-after-saving-edmx-code-is-not-gen.html Please try dotnet tool update –global dotnet-ef and restart Visual Studio
Starting with Entity Framework Core 2.1, EF supports Value Conversions to specifically address scenarios where a property needs to be mapped to a different type for storage. Specifically for Enums, you can use the provided EnumToStringConverter or EnumToNumberConverter.
Install Microsoft.EntityFrameworkCore.SqlServer 1.0.1 package works for me Version of Microsoft.EntityFrameworkCore is 1.1.0