in src/MySqlConverters.cs [136:156]
public virtual async Task<string> BuildItemFromAttributeAsync(MySqlAttribute attribute)
{
using (MySqlConnection connection = MySqlBindingUtilities.BuildConnection(attribute.ConnectionStringSetting, this._configuration))
using (var adapter = new MySqlDataAdapter())
using (MySqlCommand command = MySqlBindingUtilities.BuildCommand(attribute, connection))
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.HandleException);
adapter.SelectCommand = command;
await connection.OpenAsyncWithMySqlErrorHandling(CancellationToken.None);
var dataTable = new DataTable();
adapter.Fill(dataTable);
this.logger.LogInformation($"{dataTable.Rows.Count} row(s) queried from the query");
// Serialize any DateTime objects in UTC format
var jsonSerializerSettings = new JsonSerializerSettings()
{
DateFormatString = ISO_8061_DATETIME_FORMAT
};
return Utils.JsonSerializeObject(dataTable, jsonSerializerSettings);
}
}