Added serialization support for Int64/long.

This commit is contained in:
Sipke Schoorstra
2014-01-01 15:32:19 +01:00
parent 425d590d30
commit ae676bcb07

View File

@@ -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);
}