Skip to content
New issue

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

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

Already on GitHub? # to your account

JsonColumns vs ExecuteUpdateAsync + custom serializer for JsonColums #29675

Closed
buratinio opened this issue Nov 25, 2022 · 1 comment
Closed

Comments

@buratinio
Copy link

Is it possible to use json columns and use execute update at the same time?

For example, in your example(JsonColumns: https://github.com/ajcvickers/JsonColumns/blob/main/JsonColumns/Program.cs), if I do this in line 43:
await context.Customers
.Where(customer => customer.InformalName == "Alice")
.ExecuteUpdateAsync(x => x.SetProperty(x => x.FullName, x=> "Mrs. " + x.FullName));

there is an exception, although I can run a query in the database:
UPDATE dbo.Customers c
SET c.FullName = N'Mrs. ' + c.FullName
WHERE c.InformalName = N'Alice'

The exception would make sense if json columns were affected.
Is there any way to configure it to work the way I described?

Also, is it possible to change the serializer for json columns to custom, since the default is PascalCase, but I would like snake_case or another?
Well, other than jsonPropertyName attribute or .HasJsonPropertyName.
I mean for all entities, one custom json serializer.

@ajcvickers
Copy link
Contributor

Duplicate of #28727 and #28043. Make sure to vote (👍) for those issues.

@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants