Commits

Jacob Reimers  committed 1307fda

Included DateTime, TimeSpan and DateTimeOffset support in WinRT project.

  • Participants
  • Parent commits fe1e648
  • Branches WinRT

Comments (0)

Files changed (4)

File Linq2Rest.All.sln

 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linq2Rest.Tests.Net45", "Linq2Rest.Tests\Linq2Rest.Tests.Net45.csproj", "{BD225F81-CF2D-4CC1-9EEA-8D846765FA04}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linq2Rest.Reactive.WinRT", "Linq2Rest.Reactive.WinRT\Linq2Rest.Reactive.WinRT.csproj", "{9851DBA4-84B5-4BB2-AAD8-FF723371C204}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linq2Rest.Reactive.WinRT.Sample", "Linq2Rest.Reactive.WinRT.Sample\Linq2Rest.Reactive.WinRT.Sample.csproj", "{6097165F-D12A-4A88-B04C-B0D2A9C59C39}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|ARM = Debug|ARM
 		{1272165D-E169-4E22-B726-262AE29E5001}.Release|Any CPU.Build.0 = Release|Any CPU
 		{1272165D-E169-4E22-B726-262AE29E5001}.Release|x64.ActiveCfg = Release|Any CPU
 		{1272165D-E169-4E22-B726-262AE29E5001}.Release|x86.ActiveCfg = Release|Any CPU
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|ARM.ActiveCfg = Debug|ARM
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|ARM.Build.0 = Debug|ARM
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|ARM.Deploy.0 = Debug|ARM
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|x64.ActiveCfg = Debug|x64
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|x64.Build.0 = Debug|x64
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|x64.Deploy.0 = Debug|x64
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|x86.ActiveCfg = Debug|x86
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|x86.Build.0 = Debug|x86
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Debug|x86.Deploy.0 = Debug|x86
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|ARM.ActiveCfg = Release|ARM
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|ARM.Build.0 = Release|ARM
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|ARM.Deploy.0 = Release|ARM
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|Any CPU.Deploy.0 = Release|Any CPU
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|x64.ActiveCfg = Release|x64
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|x64.Build.0 = Release|x64
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|x64.Deploy.0 = Release|x64
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|x86.ActiveCfg = Release|x86
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|x86.Build.0 = Release|x86
+		{6097165F-D12A-4A88-B04C-B0D2A9C59C39}.Release|x86.Deploy.0 = Release|x86
 		{6D753CA4-0081-48E6-A0AD-25FFE88CD741}.Debug|ARM.ActiveCfg = Debug|Any CPU
 		{6D753CA4-0081-48E6-A0AD-25FFE88CD741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{6D753CA4-0081-48E6-A0AD-25FFE88CD741}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{8D19958C-1F14-436E-AE2C-ECD8E58998EB}.Release|Any CPU.Build.0 = Release|Any CPU
 		{8D19958C-1F14-436E-AE2C-ECD8E58998EB}.Release|x64.ActiveCfg = Release|Any CPU
 		{8D19958C-1F14-436E-AE2C-ECD8E58998EB}.Release|x86.ActiveCfg = Release|Any CPU
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|ARM.ActiveCfg = Debug|ARM
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|ARM.Build.0 = Debug|ARM
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|x64.ActiveCfg = Debug|x64
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|x64.Build.0 = Debug|x64
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|x86.ActiveCfg = Debug|x86
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Debug|x86.Build.0 = Debug|x86
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|ARM.ActiveCfg = Release|ARM
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|ARM.Build.0 = Release|ARM
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|x64.ActiveCfg = Release|x64
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|x64.Build.0 = Release|x64
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|x86.ActiveCfg = Release|x86
+		{9851DBA4-84B5-4BB2-AAD8-FF723371C204}.Release|x86.Build.0 = Release|x86
 		{B0AF1230-AF6C-4305-B4D1-7172A3BE9715}.Debug|ARM.ActiveCfg = Debug|Any CPU
 		{B0AF1230-AF6C-4305-B4D1-7172A3BE9715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{B0AF1230-AF6C-4305-B4D1-7172A3BE9715}.Debug|Any CPU.Build.0 = Debug|Any CPU

File Linq2Rest.Reactive.WinRT/Linq2Rest.Reactive.WinRT.csproj

     <Compile Include="..\Linq2Rest\Provider\Writers\ByteValueWriter.cs">
       <Link>Provider\Writers\ByteValueWriter.cs</Link>
     </Compile>
+    <Compile Include="..\Linq2Rest\Provider\Writers\DateTimeOffsetValueWriter.cs">
+      <Link>Provider\Writers\DateTimeOffsetValueWriter.cs</Link>
+    </Compile>
+    <Compile Include="..\Linq2Rest\Provider\Writers\DateTimeValueWriter.cs">
+      <Link>Provider\Writers\DateTimeValueWriter.cs</Link>
+    </Compile>
     <Compile Include="..\Linq2Rest\Provider\Writers\DecimalValueWriter.cs">
       <Link>Provider\Writers\DecimalValueWriter.cs</Link>
     </Compile>
     <Compile Include="..\Linq2Rest\Provider\Writers\StringValueWriter.cs">
       <Link>Provider\Writers\StringValueWriter.cs</Link>
     </Compile>
+    <Compile Include="..\Linq2Rest\Provider\Writers\TimeSpanValueWriter.cs">
+      <Link>Provider\Writers\TimeSpanValueWriter.cs</Link>
+    </Compile>
     <Compile Include="..\Linq2Rest\Provider\Writers\UnsignedIntValueWriter.cs">
       <Link>Provider\Writers\UnsignedIntValueWriter.cs</Link>
     </Compile>
     <Reference Include="System.Reactive.Providers">
       <HintPath>..\packages\Rx-Providers.2.0.20304-beta\lib\WinRT45\System.Reactive.Providers.dll</HintPath>
     </Reference>
+    <Reference Include="System.Xml.ReaderWriter" />
   </ItemGroup>
   <ItemGroup>
     <None Include="packages.config" />

File Linq2Rest/Provider/ExpressionVisitor.cs

 						var rightString = Visit(binaryExpression.Right, leftType, rootParameterName);
 
 						return string.Format(
-											 "{0} {1} {2}",
-											 string.Format(isLeftComposite ? "({0})" : "{0}", leftString),
-											 operation,
-											 string.Format(isRightComposite ? "({0})" : "{0}", rightString));
+							"{0} {1} {2}",
+							string.Format(isLeftComposite ? "({0})" : "{0}", leftString),
+							operation,
+							string.Format(isRightComposite ? "({0})" : "{0}", rightString));
 					}
 
 				case ExpressionType.Negate:
 						var unaryExpression = expression as UnaryExpression;
 
 						Contract.Assume(unaryExpression != null);
-					
+
 						var operand = unaryExpression.Operand;
-					
-#if !WINDOWS_PHONE
+
 						Contract.Assume(operand != null);
-#endif
 
 						return Visit(operand, rootParameterName);
 					}
+#endif
 
 				case ExpressionType.Convert:
 				case ExpressionType.Quote:
 						while (currentMemberExpression != null)
 						{
 							pathPrefixes.Add(currentMemberExpression.Member.Name);
-							if (currentMemberExpression.Expression is ParameterExpression && ((ParameterExpression)currentMemberExpression.Expression).Name != rootParameterName)
+							if (currentMemberExpression.Expression is ParameterExpression &&
+							    ((ParameterExpression) currentMemberExpression.Expression).Name != rootParameterName)
 							{
-								pathPrefixes.Add(((ParameterExpression)currentMemberExpression.Expression).Name);
+								pathPrefixes.Add(((ParameterExpression) currentMemberExpression.Expression).Name);
 							}
 
 							currentMemberExpression = currentMemberExpression.Expression as MemberExpression;
 								return Visit(collapsedExpression, rootParameterName);
 							}
 
-							memberExpression = (MemberExpression)collapsedExpression;
+							memberExpression = (MemberExpression) collapsedExpression;
 						}
 
 						var memberCall = GetMemberCall(memberExpression);
 #endif
 
 						return string.IsNullOrWhiteSpace(memberCall)
-								? prefix
-								: string.Format("{0}({1})", memberCall, Visit(innerExpression, rootParameterName));
+						       	? prefix
+						       	: string.Format("{0}({1})", memberCall, Visit(innerExpression, rootParameterName));
 					}
-
+					
 				case ExpressionType.Call:
 					var methodCallExpression = expression as MethodCallExpression;
 #if !WINDOWS_PHONE

File Linq2Rest/Provider/Writers/DateTimeValueWriter.cs

 		{
 			var dateTimeValue = (DateTime)value;
 
+#if !NETFX_CORE
 			return string.Format("datetime'{0}'", XmlConvert.ToString(dateTimeValue, XmlDateTimeSerializationMode.Utc));
+#else
+			return string.Format("datetime'{0}'", XmlConvert.ToString(dateTimeValue.ToUniversalTime()));
+#endif
 		}
 	}
 }