diff --git a/.gitignore b/.gitignore
index 8d2d841..8dd4607 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,29 +1,84 @@
-# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
-[Bb]in/
-[Oo]bj/
-
-# mstest test results
-TestResults
-
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
+*.rsuser
*.suo
*.user
+*.userosscache
*.sln.docstates
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
# Build results
[Dd]ebug/
+[Dd]ebugPublic/
[Rr]elease/
+[Rr]eleases/
x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
*_i.c
*_p.c
+*_h.h
*.ilk
*.meta
*.obj
+*.iobj
*.pch
*.pdb
+*.ipdb
*.pgc
*.pgd
*.rsp
@@ -32,35 +87,84 @@ x64/
*.tli
*.tlh
*.tmp
+*.tmp_proj
+*_wpftmp.csproj
*.log
+*.tlog
*.vspscc
*.vssscc
.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
+*.opendb
*.opensdf
*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
-_ReSharper*
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
# NCrunch
-*.ncrunch*
+_NCrunch_*
.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
-# Installshield output folder
-[Ee]xpress
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
@@ -73,42 +177,222 @@ DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
-publish
+publish/
# Publish Web Output
-*.Publish.xml
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
-# NuGet Packages Directory
-packages/
-tmp_nuget/
-vs.bat
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
-# Windows Azure Build Output
-csx
+# Microsoft Azure Build Output
+csx/
*.build.csdef
-# Windows Store app package directory
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
AppPackages/
-.nodeCs
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
# Others
-[Bb]in
-[Oo]bj
-sql
-TestResults
-[Tt]est[Rr]esult*
-*.Cache
-ClientBin
-[Ss]tyle[Cc]op.*
+ClientBin/
~$*
+*~
*.dbmdl
-Generated_Code #added for RIA/Silverlight projects
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
-# Backup & report files from converting an old project file to a newer
-# Visual Studio version. Backup files are not needed, because we have git ;-)
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+*.ncb
+*.aps
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
-App_Bin/
-PerfMon/
+# JetBrains Rider
+*.sln.iml
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/ChildItem.cs b/Linq2Rest.Reactive.Tests/Fakes/ChildItem.cs
deleted file mode 100644
index f7b644c..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/ChildItem.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the ChildItem type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System.Collections.Generic;
-
- public class ChildItem
- {
- public string Text { get; set; }
-
- public IList Descendants { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/FakeAsyncRestClientFactory.cs b/Linq2Rest.Reactive.Tests/Fakes/FakeAsyncRestClientFactory.cs
deleted file mode 100644
index 8ddb2e5..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/FakeAsyncRestClientFactory.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the FakeAsyncRestClientFactory type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System;
- using System.IO;
- using System.Threading;
- using System.Threading.Tasks;
-
- public class FakeAsyncRestClientFactory : IAsyncRestClientFactory
- {
- private readonly string _response = "[]";
- private readonly int _responseDelay;
-
- public FakeAsyncRestClientFactory()
- : this(-1)
- {
- }
-
- public FakeAsyncRestClientFactory(string response)
- : this(-1)
- {
- _response = response;
- }
-
- public FakeAsyncRestClientFactory(int responseDelay)
- {
- _responseDelay = responseDelay;
- }
-
- public Uri ServiceBase
- {
- get
- {
- return new Uri("http://localhost");
- }
- }
-
- public IAsyncRestClient Create(Uri source)
- {
- return new FakeAsyncResultClient(_responseDelay, _response);
- }
-
- public void SetMethod(HttpMethod method)
- {
- }
-
- public void SetInput(Stream input)
- {
- }
-
- private class FakeAsyncResultClient : IAsyncRestClient
- {
- private readonly string _response;
- private readonly int _responseDelay;
-
- public FakeAsyncResultClient(int responseDelay, string response)
- {
- _responseDelay = responseDelay;
- _response = response;
- }
-
- public Task Download()
- {
- return Task.Factory.StartNew(() =>
- {
- if (_responseDelay > 0)
- {
- Thread.Sleep(_responseDelay);
- }
-
- return _response.ToStream();
- });
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/FakeItem.cs b/Linq2Rest.Reactive.Tests/Fakes/FakeItem.cs
deleted file mode 100644
index 419446e..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/FakeItem.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the FakeItem type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System.Collections.Generic;
- using System.Runtime.Serialization;
- using System.Xml.Serialization;
-
- [DataContract]
- public class FakeItem
- {
- [DataMember(Name = "Text")]
- private string _stringValue;
-
- [XmlElement(ElementName = "Number")]
- public int IntValue { get; set; }
-
- public double DoubleValue { get; set; }
-
- public string StringValue
- {
- get
- {
- return _stringValue;
- }
-
- set
- {
- _stringValue = value;
- }
- }
-
- public IList Children { get; set; }
-
- public IList MoreChildren { get; set; }
- }
-}
diff --git a/Linq2Rest.Reactive.Tests/Fakes/NorthwindCustomer.cs b/Linq2Rest.Reactive.Tests/Fakes/NorthwindCustomer.cs
deleted file mode 100644
index 4f8257a..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/NorthwindCustomer.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the NorthwindCustomer type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- public class NorthwindCustomer
- {
- public string CustomerID { get; set; }
-
- public string CompanyName { get; set; }
-
- public string ContactName { get; set; }
-
- public string ContactTitle { get; set; }
-
- public string Address { get; set; }
-
- public string City { get; set; }
-
- public string Region { get; set; }
-
- public string PostalCode { get; set; }
-
- public string Country { get; set; }
-
- public string Phone { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/ODataResponse.cs b/Linq2Rest.Reactive.Tests/Fakes/ODataResponse.cs
deleted file mode 100644
index 451da62..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/ODataResponse.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the ODataResponse type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System.Collections.Generic;
- using System.Runtime.Serialization;
-
- [DataContract]
- public class ODataResponse
- {
- [DataMember(Name = "value")]
- public List Results { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/ODataResult.cs b/Linq2Rest.Reactive.Tests/Fakes/ODataResult.cs
deleted file mode 100644
index 58eeaf2..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/ODataResult.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the ODataResult type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System.Collections.Generic;
- using System.Runtime.Serialization;
-
- [DataContract]
- public class ODataResult
- {
- [DataMember(Name = "value")]
- public List Results { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/TestComplexSerializer.cs b/Linq2Rest.Reactive.Tests/Fakes/TestComplexSerializer.cs
deleted file mode 100644
index b2126d9..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/TestComplexSerializer.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the TestComplexSerializer type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Runtime.Serialization.Json;
- using Linq2Rest.Provider;
-
- public class TestComplexSerializer : ISerializer
- {
- private readonly DataContractJsonSerializer _innerListSerializer = new DataContractJsonSerializer(typeof(List));
- private readonly DataContractJsonSerializer _innerSerializer = new DataContractJsonSerializer(typeof(FakeItem));
-
- public FakeItem Deserialize(Stream input)
- {
- return (FakeItem)_innerSerializer.ReadObject(input);
- }
-
- public IEnumerable DeserializeList(Stream input)
- {
- return (List)_innerListSerializer.ReadObject(input);
- }
-
- public Stream Serialize(FakeItem item)
- {
- var stream = new MemoryStream();
- _innerSerializer.WriteObject(stream, item);
- stream.Flush();
- stream.Position = 0;
-
- return stream;
- }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/TestODataSerializer.cs b/Linq2Rest.Reactive.Tests/Fakes/TestODataSerializer.cs
deleted file mode 100644
index 6c4334d..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/TestODataSerializer.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the TestODataSerializer type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Runtime.Serialization.Json;
- using Linq2Rest.Provider;
-
- public class TestODataSerializer : ISerializer
- {
- private readonly DataContractJsonSerializer _innerSerializer = new DataContractJsonSerializer(typeof(ODataResponse));
-
- public T Deserialize(Stream input)
- {
- var response = (ODataResponse)_innerSerializer.ReadObject(input);
- return response.Results.FirstOrDefault();
- }
-
- public IEnumerable DeserializeList(Stream input)
- {
- var response = (ODataResponse)_innerSerializer.ReadObject(input);
- return response.Results;
- }
-
- public Stream Serialize(T item)
- {
- var stream = new MemoryStream();
- _innerSerializer.WriteObject(stream, item);
- stream.Flush();
- stream.Position = 0;
-
- return stream;
- }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/TestODataSerializerFactory.cs b/Linq2Rest.Reactive.Tests/Fakes/TestODataSerializerFactory.cs
deleted file mode 100644
index a5a3b01..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/TestODataSerializerFactory.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the TestODataSerializerFactory type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using Linq2Rest.Provider;
-
- public class TestODataSerializerFactory : ISerializerFactory
- {
- public ISerializer Create()
- {
- return new TestODataSerializer();
- }
-
- public ISerializer Create()
- {
- return Create();
- }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/TestSerializer.cs b/Linq2Rest.Reactive.Tests/Fakes/TestSerializer.cs
deleted file mode 100644
index f7646ad..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/TestSerializer.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the TestSerializer type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Runtime.Serialization.Json;
- using Linq2Rest.Provider;
-
- public class TestSerializer : ISerializer
- {
- private readonly DataContractJsonSerializer _innerListSerializer = new DataContractJsonSerializer(typeof(List));
- private readonly DataContractJsonSerializer _innerSerializer = new DataContractJsonSerializer(typeof(T));
-
- public T Deserialize(Stream input)
- {
- return (T)_innerSerializer.ReadObject(input);
- }
-
- public IEnumerable DeserializeList(Stream input)
- {
- return (List)_innerListSerializer.ReadObject(input);
- }
-
- public Stream Serialize(T item)
- {
- var stream = new MemoryStream();
- _innerSerializer.WriteObject(stream, item);
- stream.Flush();
- stream.Position = 0;
-
- return stream;
- }
- }
-}
\ No newline at end of file
diff --git a/Linq2Rest.Reactive.Tests/Fakes/TestSerializerFactory.cs b/Linq2Rest.Reactive.Tests/Fakes/TestSerializerFactory.cs
deleted file mode 100644
index a47f911..0000000
--- a/Linq2Rest.Reactive.Tests/Fakes/TestSerializerFactory.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright © Reimers.dk 2014
-// This source is subject to the Microsoft Public License (Ms-PL).
-// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-// All other rights reserved.
-//
-//
-// Defines the TestSerializerFactory type.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace Linq2Rest.Reactive.Tests.Fakes
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Diagnostics.Contracts;
- using System.IO;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Reflection;
- using System.Web.Script.Serialization;
- using Linq2Rest.Provider;
-
- public class TestSerializerFactory : ISerializerFactory
- {
- private readonly IMemberNameResolver _memberNameResolver;
-
- public TestSerializerFactory()
- {
- _memberNameResolver = new MemberNameResolver();
- }
-
- public ISerializer Create()
- {
- if (typeof(T) == typeof(FakeItem))
- {
- return new TestComplexSerializer() as ISerializer;
- }
-
- return new TestSerializer();
- }
-
- public ISerializer Create()
- {
- if (typeof(T).IsAnonymousType())
- {
- return new RuntimeAnonymousTypeSerializer(_memberNameResolver);
- }
- return Create();
- }
- }
-
- ///
- /// Serializes simples annymous type structures.
- ///
- /// The to serialize.
- /// The to load alias data from.
- public class RuntimeAnonymousTypeSerializer : ISerializer
- {
- private readonly IMemberNameResolver _nameResolver;
- private readonly Type _sourceType = typeof(TSource);
- private readonly Type _elementType = typeof(T);
- private readonly Type _deserializedType = typeof(Dictionary);
- private readonly JavaScriptSerializer _innerSerializer = new JavaScriptSerializer();
-
- ///
- /// a
- ///
- /// The used to resolve name aliasing.
- public RuntimeAnonymousTypeSerializer(IMemberNameResolver nameResolver)
- {
- _nameResolver = nameResolver;
- }
-
- ///
- /// Deserializes a single item.
- ///
- /// The serialized item.
- /// An instance of the serialized item.
- public T Deserialize(Stream input)
- {
- var content = new StreamReader(input).ReadToEnd();
-
- var dictionary = (Dictionary)_innerSerializer.DeserializeObject(content);
- var selectorFunction = CreateSelector(dictionary);
- return selectorFunction(dictionary);
- }
-
- ///
- /// Deserializes a list of items.
- ///
- /// The serialized items.
- /// An list of the serialized items.
- public IEnumerable DeserializeList(Stream input)
- {
- var content = new StreamReader(input).ReadToEnd();
- return ReadToAnonymousType(content);
- }
-
- ///
- /// Serializes the passed item into a .
- ///
- /// The item to serialize.
- /// A representation of the item.
- public Stream Serialize(T item)
- {
- var ms = new MemoryStream();
- var writer = new StreamWriter(ms);
- writer.Write(_innerSerializer.Serialize(item));
- writer.Flush();
- ms.Position = 0;
- return ms;
- }
-
- private static Type GetMemberType(MemberInfo member)
- {
- switch (member.MemberType)
- {
- case MemberTypes.Field:
- return ((FieldInfo)member).FieldType;
- case MemberTypes.Method:
- return ((MethodInfo)member).ReturnType;
- case MemberTypes.Property:
- return ((PropertyInfo)member).PropertyType;
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
- private IEnumerable ReadToAnonymousType(string response)
- {
- var deserializeObject = _innerSerializer.DeserializeObject(response);
- var enumerable = deserializeObject as IEnumerable;
-
- if (enumerable == null)
- {
- return new List();
- }
-
- var objectEnumerable = enumerable.OfType>().ToArray();
-
- if (objectEnumerable.Length == 0)
- {
- return new List();
- }
-
- var first = objectEnumerable[0];
-
- var selectorFunction = CreateSelector(first);
-
- Contract.Assume(selectorFunction != null, "Compiled above.");
-
- return objectEnumerable.Select(selectorFunction).ToList();
- }
-
- private Func