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.
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.
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)");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With