add net60 DateOnly mapping SqlServer

This commit is contained in:
2881099
2021-11-22 21:42:25 +08:00
parent 352ceceb23
commit b26a581f82
15 changed files with 50 additions and 26 deletions

View File

@ -113,6 +113,13 @@ namespace FreeSql.SqlServer
var ts = (TimeSpan)value;
value = $"{ts.Hours}:{ts.Minutes}:{ts.Seconds}.{ts.Milliseconds}";
}
#if net60
if (type == typeof(TimeOnly) || type == typeof(TimeOnly?))
{
var ts = (TimeOnly)value;
value = $"{ts.Hour}:{ts.Minute}:{ts.Second}.{ts.Millisecond}";
}
#endif
return string.Format(CultureInfo.InvariantCulture, "{0}", (_orm.Ado as AdoProvider).AddslashesProcessParam(value, type, col));
}
}