OrleansContrib/Orleans.Providers.EntityFramework

System.InvalidOperationException: No value provided for required parameter '__grainKey'.

james-carroll-bencin opened this issue · 3 comments

I've been running into this issue for a while now and can't seem to find a solution. I believe it's coming from the CreateKeyPredicate and CreatePreCompiledDefaultReadStateFunc methods inside of the GrainStorageConvention. Do you have any idea why this is happening?

For some background info, I have an ASP.NET Core 3 project that was using EF Core 3 to talk to a SQL DB. I'm now trying to use Orleans as middleware between the API and DB to help the project scale. I upgraded my models to match the default grain storage convention and applied the migrations to the DB but now I'm running into the above error. Is there something I'm missing with the DB structure?

@james-carroll-bencin Which version are you using?
There shouldn't be any restriction on how you make your models, at least it's not intended. If your models don't match the convention you can change the convention. Can you make a repro?

Also I haven't tested this against EF Core 3. Will look into it in a few days I'm on vacation right now.

I was using the latest on nuget. The repo I currently have has a lot of code I can't share but I will try to make a small example to show the bug this weekend.

Have fun on your vacation.

@james-carroll-bencin Sorry for the very late response.
I played with it for a while. Seems it's caused by a breaking change in EF core 3.0. I opened an issue for it.

Meanwhile you can disable query precompilation if you're still stuck.