Closed alastairandrew closed 1 year ago
Hello @alastairandrew ,
It looks like you didn't attach the project correctly. Your post doesn't look to contain it.
Best Regards,
Jon
Sponsorship Help us improve this library
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Dapper Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function
Hi @JonathanMagnan
Whoops, I've edited the original post and attached EffortBugReport.zip which is the solution. Sorry about that.
Cheers, AA
Thank you @alastairandrew ,
We can successfully reproduce the issue with your project.
My developer will look at it. We already support enum
so I believe it should not be a problem to support nullable enum
.
Best Regards,
Jon
Hello @alastairandrew ,
Just to let you know that the fix has been merged in our master.
The fix will be part of the next release of Z.EntityFramework.Extensions that should happen on 2023-09-12
I will let you know when the fix will be available
Hello @alastairandrew ,
The v7.100.0.0 of Entity Framework Extensions has been released today.
Our library should now support nullable enum
. Let us know if everything works as expected.
Best Regards,
Jon
Hi @JonathanMagnan,
I've upgraded to the latest release and can confirm that the issue is resolved now. Thanks so much for the speedy turnaround and great comms.
Much appreciated, Alastair
EffortBugReport.zip
1. Description
When trying to use EntityFramework.BulkInsert method on a class that contains a nullable enum the insert fails due to a InvalidCastException. It appears as though the object's enum is being treated as its value name rather than the underlying int value during the insert somewhere.
2. Exception
3. Fiddle or Project
I've attached a minimal solution that reproduces the error I see in my actual project. The versions of the packages all match what we're using. There's a single test that populates some example data (with all three possible enum states) which it then attempts to "clone" (which is the feature we're writing and want to use Effort to unit test).
4. Any further technical details
Add any relevant detail can help us.