Using Guid Ids with ServiceStack 4 and MySQL -
how change serialization method guids in ormlite.mysql servicestack 4?
version 3 mysql stored guids text without dashes, , likewise didn't use dashes comparisons.
after upgrading servicestack 4, ups return no data. in mysql log, queries sent ormlite include dashes , that's why there's no matches. need set previous behaviour.
i have customized serialization settings follows. apply ormlite dtos?
void customserializationsettings() { servicestack.text.jsconfig<guid>.serializefn = guid => guid.tostring(); servicestack.text.jsconfig<guid?>.serializefn = guid => guid.hasvalue ? guid.tostring() : string.empty; servicestack.text.jsconfig.includenullvalues = true; servicestack.text.jsconfig.datehandler = servicestack.text.datehandler.iso8601; servicestack.text.jsconfig<datetime>.serializefn = datetimeserialising.serialisedate; servicestack.text.jsconfig<datetime>.deserializefn = datetimeserialising.deserialisedate; servicestack.text.jsconfig<datetime?>.serializefn = datetimeserialising.serialisedaten; servicestack.text.jsconfig<datetime?>.deserializefn = datetimeserialising.deserialisedaten; }
this breaking change in v4.09 mysql , sqlite treats guids char(36), special casing of guids removed mysql , sqlite providers same sql linq expression work across providers.
as inferred namespace servicestack.text.jsconfig
applies text serialization, not ormlite. there's no easy override other use custom mysqldialectprovider overrides ormlite's mysqldialectprovider add special-casing in. recommendation upgrade data use new (natural) guid.tostring()
format;
Comments
Post a Comment