core-admin icon indicating copy to clipboard operation
core-admin copied to clipboard

Not working with EntityFrameWork 9.0.0 and .net 8.0.300 Versions (I am a newbie in .NET )

Open kaankarakoc42 opened this issue 11 months ago • 3 comments

An unhandled exception occurred while processing the request. MissingMethodException: Method not found: 'System.Collections.Generic.List`1<Microsoft.EntityFrameworkCore.Metadata.RuntimeForeignKey> Microsoft.EntityFrameworkCore.Metadata.RuntimeProperty.get_ForeignKeys()'. DotNetEd.CoreAdmin.Controllers.CoreAdminDataController.GetDbSetValueOrNull(string dbSetName, out DbContext dbContextObject, out Type typeOfEntity, out Dictionary<string, Dictionary<object, string>> relationships)

kaankarakoc42 avatar Jan 03 '25 23:01 kaankarakoc42

There is a breaking change in the framework, download the repo and edit below and reference the changed DotNetEd.CoreAdmin.csproj from your project until an updated nuget package is published.

Change line 92 to var typeOfChild = f.ForeignKeys.First(); DotNetEd.CoreAdmin\Controllers\CoreAdminDataController.cs

ForeignKeys[0] is no longer a valid accessor as it has no indexer

joepperkins avatar Jan 04 '25 21:01 joepperkins

There is a breaking change in the framework, download the repo and edit below and reference the changed DotNetEd.CoreAdmin.csproj from your project until an updated nuget package is published.

Change line 92 to var typeOfChild = f.ForeignKeys.First(); DotNetEd.CoreAdmin\Controllers\CoreAdminDataController.cs

ForeignKeys[0] is no longer a valid accessor as it has no indexer

It's not work.

syuhung avatar Jan 08 '25 05:01 syuhung

i try to update EntityFrameworkCore package to 9.0.0.0 and it finally work.

syuhung avatar Jan 08 '25 06:01 syuhung

Alright full guide so you don't have to struggle for three hours like me:

  1. First remove the package
  2. download or clone the repo.
  3. extract the DotNetEd.CoreAdmin folder from the project: \core-admin-master\core-admin-master\src\ and place it in the same folder as the rest or your projects: source\repos\ Do NOT put it in your project folder
  4. Add this to your existing project by right-clicking the Solution in the Solution explorer and then going to the Add option - Exsisting Project - then navigate to \source\repos\DotNetEd.CoreAdmin\ and click on the DotNetEd.CoreAdmin.csproj file
  5. Then you need to clean and rebuild the project.
  6. go to the DotNetEd.CoreAdmin\Controllers\CoreAdminDataController.cs file and change line 92 to var typeOfChild = f.ForeignKeys.First();
  7. Now you need to go and update the dependencies for the DotNetEd.CoreAdmin solution make sure to update the EntityFrameworkCore package to at least 9.0.0.0

Then you should be done!

David-Vermaak avatar Jul 16 '25 14:07 David-Vermaak