Skip to content

Sql trigger cannot deserialize types with properties stored as json #908

Open
@bcrispcvna

Description

@bcrispcvna

The SQL trigger fails when trying to deserialize types that have columns stored as Json that map to object types (for example an owned type that was stored as Json in EFCore). I tried adding a custom converter for handling this in the function startup but can't seem to override the default serialization behavior.

For now, I have two options for working around the issue. One method that worked was adding a class that specified the properties as strings, using that as the SqlChange<> type, then converting it to the target type in the function. I was also able to pass in JObject as the type for SqlChange<> and then use the custom converter inside of the JObject.ToObject method to convert.

https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/src/TriggerBinding/SqlTableChangeMonitor.cs#L705

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtrigger

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions