IGNITE-1619: Fix to DateTime serialization.

Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/91f244e6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/91f244e6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/91f244e6

Branch: refs/heads/ignite-1655
Commit: 91f244e63fe778fe8c49491d04c8623b7c4915ba
Parents: 9feec40
Author: vozerov-gridgain <[email protected]>
Authored: Fri Oct 23 11:33:44 2015 +0300
Committer: vozerov-gridgain <[email protected]>
Committed: Fri Oct 23 11:33:44 2015 +0300

----------------------------------------------------------------------
 .../Impl/Portable/PortableSystemHandlers.cs     | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/91f244e6/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableSystemHandlers.cs
----------------------------------------------------------------------
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableSystemHandlers.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableSystemHandlers.cs
index c5f75a5..6ad4aad 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableSystemHandlers.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableSystemHandlers.cs
@@ -164,11 +164,11 @@ namespace Apache.Ignite.Core.Impl.Portable
             // 1. Well-known types.
             if (type == typeof (string))
                 return WriteString;
-            if (type == typeof(decimal))
+            if (type == typeof(decimal?))
                 return WriteDecimal;
-            if (type == typeof(DateTime))
+            if (type == typeof(DateTime?))
                 return WriteDate;
-            if (type == typeof(Guid))
+            if (type == typeof(Guid?))
                 return WriteGuid;
             if (type == typeof (PortableUserObject))
                 return WritePortable;
@@ -210,18 +210,14 @@ namespace Apache.Ignite.Core.Impl.Portable
                 if (elemType == typeof(ulong))
                     return WriteUlongArray;
                 // Special types.
-                else if (elemType == typeof (decimal?))
+                if (elemType == typeof (decimal?))
                     return WriteDecimalArray;
                 if (elemType == typeof(string))
                     return WriteStringArray;
-//                else if (elemType == typeof(DateTime))
-//                    return WriteDateArray;
                 if (elemType == typeof(DateTime?))
-                    return WriteNullableDateArray;
-//                else if (elemType == typeof(Guid))
-//                    return WriteGuidArray;
+                    return WriteTimestampArray;
                 if (elemType == typeof(Guid?))
-                    return WriteNullableGuidArray;
+                    return WriteGuidArray;
                 // Enums.
                 if (elemType.IsEnum)
                     return WriteEnumArray;
@@ -489,7 +485,7 @@ namespace Apache.Ignite.Core.Impl.Portable
         /// </summary>
         /// <param name="ctx">Context.</param>
         /// <param name="obj">Value.</param>
-        private static void WriteNullableDateArray(PortableWriterImpl ctx, 
object obj)
+        private static void WriteTimestampArray(PortableWriterImpl ctx, object 
obj)
         {
             ctx.Stream.WriteByte(PortableUtils.TypeArrayTimestamp);
 
@@ -513,7 +509,7 @@ namespace Apache.Ignite.Core.Impl.Portable
         /// </summary>
         /// <param name="ctx">Context.</param>
         /// <param name="obj">Value.</param>
-        private static void WriteNullableGuidArray(PortableWriterImpl ctx, 
object obj)
+        private static void WriteGuidArray(PortableWriterImpl ctx, object obj)
         {
             ctx.Stream.WriteByte(PortableUtils.TypeArrayGuid);
 

Reply via email to