Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HasData for List<X> type fields #2401

Closed
yinzara opened this issue Jun 9, 2022 · 3 comments · May be fixed by #2402
Closed

Support HasData for List<X> type fields #2401

yinzara opened this issue Jun 9, 2022 · 3 comments · May be fixed by #2402

Comments

@yinzara
Copy link

yinzara commented Jun 9, 2022

When using a List<string> type field, the mapping properly becomes a text[] type in PostgreSQL and works normally.
However we can't use UseData with an entity that has this mapping as we get the following exception:

The type mapping for 'List<string>' has not implemented code literal generation.

I would love it if the type mapping for List<string> supported code literal generation.

@roji
Copy link
Member

roji commented Jun 9, 2022

@yinzara you should be able to use an array (string[]) in HasData, have you tried that?

@yinzara yinzara changed the title Support HasData for Array type fields Support HasData for List<string> type fields Jun 10, 2022
@yinzara
Copy link
Author

yinzara commented Jun 10, 2022

Yes, that does work :-)
But List<X> does not.

I'm actually implementing this right now and have a PR to make it work.

@yinzara yinzara changed the title Support HasData for List<string> type fields Support HasData for List<X> type fields Jun 10, 2022
yinzara added a commit to yinzara/efcore.pg that referenced this issue Jun 10, 2022
yinzara added a commit to yinzara/efcore.pg that referenced this issue Jun 10, 2022
@roji
Copy link
Member

roji commented Aug 1, 2022

Closing as this was done on the EF side (dotnet/efcore#28212).

@roji roji closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants