Interestingly enough I ended up going to one of those chat agents to crank
out some boilerplate, which I reviewed, and mostly liked the result, with a
couple of adjustments on my part. I think I have it somewhat sorted now.
We'll see how it works. The only other thing I might consider is whether
the pg JSON dialect needs stronger support than just an open String(2K) or
what have you. Like I think those types can potentially be better mapped
via Npgsql terms IIRC. Will have to see.
On Sunday, June 1, 2025 at 1:22:39 PM UTC-4 Michael W Powell wrote:
> I'm looking for a halfway decent IUserType implementation in support of
> JSON serialized columns. Many of the examples I am finding seem to assume
> that a default JSON representation should be an object i.e. "{}". However,
> I do have a couple of instances in which I actually want an array, i.e.
> "[]". That's number one.
>
> Number two, are there other methods or extensions methods of the Map(...)
> that allow further customization of such an implementation than just a
> default constructor (presumably), i.e.
>
> Map(x => x.Features)
> .CustomType<JsonColumnType<IList<string>>>()
> .Column((nameof(ServerProfile.Features) + "Json").ToCamelCase())
> .Not.Nullable()
> ;
>
> And then, if I would like to do a measure of custom JSON serialization to
> from the source property, then what. Other than of course a nominal default
> implementation.
>
> I might like to do something like this for instance, but I do not see that
> extension:
>
> Map(x => x.Features)
> .CustomType<JsonColumnType<IList<string>>>(() => /* do something to
> initialize and configure */ )
> ;
>
> Thank you, best,
>
> Michael W. Powell
>
>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/nhusers/91a1bae7-352f-4eaa-984a-54d1551ba89cn%40googlegroups.com.