mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Added serialization support for Int64/long.
This commit is contained in:
@@ -175,7 +175,9 @@ namespace Orchard.ContentManagement {
|
||||
}
|
||||
|
||||
if (type == typeof(int) ||
|
||||
type == typeof(int?)) {
|
||||
type == typeof(int?) ||
|
||||
type == typeof(long) ||
|
||||
type == typeof(long?)) {
|
||||
|
||||
return Convert.ToInt64(value).ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
@@ -252,6 +254,9 @@ namespace Orchard.ContentManagement {
|
||||
if (type == typeof(int) || type == typeof(int?)) {
|
||||
return (T)(object)int.Parse(value, CultureInfo.InvariantCulture);
|
||||
}
|
||||
if (type == typeof(long) || type == typeof(long?)) {
|
||||
return (T)(object)long.Parse(value, CultureInfo.InvariantCulture);
|
||||
}
|
||||
if (type == typeof(bool) || type == typeof(bool?)) {
|
||||
return (T)(object)value.Equals("true", StringComparison.Ordinal);
|
||||
}
|
||||
|
Reference in New Issue
Block a user