One property in our model is of type DateTimeOffset, in the database the values are correctly stored in a culture-agnostic way using ISO formatting.
We also implement IDbCommandInterceptor to log database activity. There however, logging of a DbParameter.Value.ToString() fails for the SQLiteDateTime with the attached exception if CurrentUICulture is switched to a different value than the default for the system.
Exception:
Code: Select all
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
at System.String.Substring(Int32 startIndex, Int32 length)
at Devart.Data.SQLite.SQLiteDateTime.ToString(String format)
at Vector.ReportViewer.Data.DatabaseAccess.DatabaseLogger.OnEnd[T](DbCommand command, DbCommandInterceptionContext`1 interceptionContext)