Replies: 1 comment
-
|
OK, found the issue in the wiki!. I changed the VO to include the converter... [ValueObject<int>(conversions: Conversions.EfCoreValueConverter)]
public partial struct CompanyId;,,,and it worked 😎[*]. Hope this helps someone. [*] As I was doing this on an existing database (I started off using a plain
In my case, this was a test app, so I just dropped the database, deleted all the migrations and started again, but that might not always be practical. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just trying to get the hang of this library, and am running into a problem.
I set up a simple Blazor app that uses EF Core against SQL Server. I added a model for a company, and a VO for the Id...
In order to make this work with EF, I followed the tips on this wiki page. I added the extension class and called it from the
DbContextclass.However, when I try the following...
...then I get the exception mention in the title.
I did some digging around in the extension method, and added a load of logging...
The only significant code change is that I split the
ifstatement in the first method to cut down on the logging for non-Vogen types.When the code runs, I get the following output...
So I guess the exception is caused because it can't find a converter. The question is, why can't it find a converter? As far as I can see, I did everything according to the wiki.
Anyone able to explain what I did wrong? Thanks
Beta Was this translation helpful? Give feedback.
All reactions