Merge pull request #623 from jiaguangli/master

add dateTime nullable support
This commit is contained in:
Gary Jia 2024-07-08 09:34:58 +08:00 committed by GitHub
commit ecc049765d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -122,6 +122,8 @@
newValue = _v2;
else if (double.TryParse(vs, NumberStyles.None, CultureInfo.InvariantCulture, out var _d))
newValue = DateTimeHelper.FromOADate(_d);
else if (pInfo.Nullable && string.IsNullOrWhiteSpace(vs))
newValue = null;
else
throw new InvalidCastException($"{vs} can't cast to datetime");
}