I’m deserializing a CSV file that use ~
as the delimiter. Is there a thread safe way to do this in a request, since CsvConfig
is static? I can reset it after I’m done deseralizing by calling CsvConfig.Reset()
(if I don’t do this, subsequent requests that specify csv output get ~
delimited), but is there a better way?
No it’s a global configuration that’s not designed to support scoped adhoc configuration, you’d need to protect all CSV serialisation with a lock if you want to make it threadsafe, but you’re much better off using a different CSV library for scoped config so you don’t interfere with ServiceStack’s other runtime CSV serialization.