efcore: Bug when trying to seed with anonymous types
Using: .NET 5 Preview 5.
My model has two int? (optional) values. When I try to seed without those values (optional) in an anonymous type, I get:
The number of values (9) doesn't match the number of columns (11) for the data insertion operation on 'customers'. Provide the same number of values and columns.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- Correctly generate null literals in arrays Fixes #21244 — committed to dotnet/efcore by AndriySvyryd 4 years ago
- Correctly generate null literals in arrays (#21736) Fixes #21244 — committed to dotnet/efcore by AndriySvyryd 4 years ago
Note for triage: I am able to reproduce this. The generated migration contains:
@AndriySvyryd Still repros on latest daily. Also, I can’t see how this can be uncommon, so I’m putting it in 5.0 for now. (I may be missing something about why this doesn’t happen more often.)