2
votes

What Nuget package is System.Data.Entity in?

I am converting a .NET Framework 4.5 app to .NET Core 3.1. In .NET Framework, it is using System.Linq.Dynamic, and the app is crashing when running this code:

var results = report.GroupBy(filter.ID, "it")
                    .Select($"new (it.Key as MainID, it as MyModel)");

With this error message:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. File name: 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' at System.Linq.Dynamic.ExpressionParser..cctor()

Note: it does compile correctly

thanks

edit: The System.Linq.Dynamic Nuget package is installed.

2
You can have a look at this package and this GitHub repo I'm not sure, that they are same, but it should help youPavel Anikhouski
@PavelAnikhouski that did, had to add .AsQueryable() but it worked perfectly! if you add this as an answer I will give you creditXaphann

2 Answers

1
votes

One point I would like to add to @PavelAnikhouski, a very minor change needs to be made to the code. You have to add AsQueryable() to the collection.

var results = report.AsQueryable()
                .GroupBy(filter.ID, "it")
                .Select($"new (it.Key as MainID, it as MyModel)");
1
votes

It seems that System.Data.Entity and System.Linq.Dynamic assemblies belongs to .NET Framework. For .NET Core you can try to use System.Linq.Dynamic.Core package, it's compatible with .NET Standard. Its GitHub repo says, that it's .NET core port of the assembly for the .NET 4.0 Dynamic language functionality.