Closed killnine closed 3 months ago
I've tried calling this in my unit test which is testing the bulk-insert functionality but it's a no-go so far:
MappingSchema.Default.SetConverter<List<string>, object>(list => JsonSerializer.Serialize(list));
MappingSchema.Default.SetConverter<List<string>, SqlString>(list => JsonSerializer.Serialize(list));
MappingSchema.Default.SetConverter<List<string>, string>(list => JsonSerializer.Serialize(list));
MappingSchema.Default.SetConverter<IList<string>, object>(list => JsonSerializer.Serialize(list));
MappingSchema.Default.SetConverter<IList<string>, SqlString>(list => JsonSerializer.Serialize(list));
MappingSchema.Default.SetConverter<IList<string>, string>(list => JsonSerializer.Serialize(list));
Figured it out and posted solution here: https://stackoverflow.com/questions/78255883/not-handling-json-conversion-of-iliststring-into-database
Hello,
I'm very new to Linq2DB and this EFCore plugin for it. However, I noticed when trying to implement bulk-insert that some columns that otherwise work in EFCore fail with the following exception:
The class which contains the property in question is set up like this:
While the Field in the (SQL Server) database is an
nvarchar(max)
.The class which configures the table for this class is setup like this:
Is
MappingSchema.Default.SetValueToSqlConverter(typeof(IList<string>), ...)
an appropriate method to convert lists of strings to a nvarchar? Has anyone done something similar?