Skip to content

Commit 553d0a3

Browse files
Nested Cosmos Db compatibility (#352)
* Add RenameEmptyParameterExpressionNames configuration. * Add ConsoleApp_netcore2.1_CosmosDb test console. * Add ParameterExpressionHelper unit tests. CodeFactor feedback. * More unit tests for ParameterExpressionHelper. * Code review feedback. * Add comment to IsNullOrWhiteSpace method to explain why we cannot use string.IsNullOrWhiteSpace.
1 parent d7ae34d commit 553d0a3

18 files changed

+738
-9
lines changed

System.Linq.Dynamic.Core.sln

+38
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp.EntityFrameworkC
7373
EndProject
7474
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp_netcore3.1_EF3.1", "src-console\ConsoleAppEF3.1\ConsoleApp_netcore3.1_EF3.1.csproj", "{6D21EBF2-C92D-4AE0-9BC3-47C63928F88A}"
7575
EndProject
76+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp_netcore2.1_CosmosDb", "src-console\ConsoleApp_netcore2.1_CosmosDb\ConsoleApp_netcore2.1_CosmosDb.csproj", "{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}"
77+
EndProject
78+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp_net452_CosmosDb", "src-console\ConsoleApp_net452_CosmosDb\ConsoleApp_net452_CosmosDb.csproj", "{0034821E-740D-4553-821B-14CE9213C43C}"
79+
EndProject
7680
Global
7781
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7882
Debug|Any CPU = Debug|Any CPU
@@ -439,6 +443,38 @@ Global
439443
{6D21EBF2-C92D-4AE0-9BC3-47C63928F88A}.Release|x64.Build.0 = Release|Any CPU
440444
{6D21EBF2-C92D-4AE0-9BC3-47C63928F88A}.Release|x86.ActiveCfg = Release|Any CPU
441445
{6D21EBF2-C92D-4AE0-9BC3-47C63928F88A}.Release|x86.Build.0 = Release|Any CPU
446+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
447+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
448+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|ARM.ActiveCfg = Debug|Any CPU
449+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|ARM.Build.0 = Debug|Any CPU
450+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|x64.ActiveCfg = Debug|Any CPU
451+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|x64.Build.0 = Debug|Any CPU
452+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|x86.ActiveCfg = Debug|Any CPU
453+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Debug|x86.Build.0 = Debug|Any CPU
454+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
455+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|Any CPU.Build.0 = Release|Any CPU
456+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|ARM.ActiveCfg = Release|Any CPU
457+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|ARM.Build.0 = Release|Any CPU
458+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|x64.ActiveCfg = Release|Any CPU
459+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|x64.Build.0 = Release|Any CPU
460+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|x86.ActiveCfg = Release|Any CPU
461+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB}.Release|x86.Build.0 = Release|Any CPU
462+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
463+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|Any CPU.Build.0 = Debug|Any CPU
464+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|ARM.ActiveCfg = Debug|Any CPU
465+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|ARM.Build.0 = Debug|Any CPU
466+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|x64.ActiveCfg = Debug|Any CPU
467+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|x64.Build.0 = Debug|Any CPU
468+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|x86.ActiveCfg = Debug|Any CPU
469+
{0034821E-740D-4553-821B-14CE9213C43C}.Debug|x86.Build.0 = Debug|Any CPU
470+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|Any CPU.ActiveCfg = Release|Any CPU
471+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|Any CPU.Build.0 = Release|Any CPU
472+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|ARM.ActiveCfg = Release|Any CPU
473+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|ARM.Build.0 = Release|Any CPU
474+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|x64.ActiveCfg = Release|Any CPU
475+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|x64.Build.0 = Release|Any CPU
476+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|x86.ActiveCfg = Release|Any CPU
477+
{0034821E-740D-4553-821B-14CE9213C43C}.Release|x86.Build.0 = Release|Any CPU
442478
EndGlobalSection
443479
GlobalSection(SolutionProperties) = preSolution
444480
HideSolutionNode = FALSE
@@ -466,6 +502,8 @@ Global
466502
{D3804228-91F4-4502-9595-39584EA20000} = {DBD7D9B6-FCC7-4650-91AF-E6457573A68F}
467503
{0077F262-D69B-44D2-8A7C-87D8D19022A6} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
468504
{6D21EBF2-C92D-4AE0-9BC3-47C63928F88A} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
505+
{D160E2CF-A7E1-4DDE-9AB8-8CFB0087DCEB} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
506+
{0034821E-740D-4553-821B-14CE9213C43C} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
469507
EndGlobalSection
470508
GlobalSection(ExtensibilityGlobals) = postSolution
471509
SolutionGuid = {94C56722-194E-4B8B-BC23-B3F754E89A20}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{0034821E-740D-4553-821B-14CE9213C43C}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>ConsoleAppCosmosDb</RootNamespace>
10+
<AssemblyName>ConsoleAppCosmosDb</AssemblyName>
11+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<PropertyGroup>
38+
<StartupObject>ConsoleAppCosmosDb.Program</StartupObject>
39+
</PropertyGroup>
40+
<ItemGroup>
41+
<Reference Include="Microsoft.Azure.Documents.Client, Version=2.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
42+
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.2.5.1\lib\net45\Microsoft.Azure.Documents.Client.dll</HintPath>
43+
</Reference>
44+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
45+
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
46+
</Reference>
47+
<Reference Include="System" />
48+
<Reference Include="System.Core" />
49+
<Reference Include="System.Xml.Linq" />
50+
<Reference Include="System.Data.DataSetExtensions" />
51+
<Reference Include="Microsoft.CSharp" />
52+
<Reference Include="System.Data" />
53+
<Reference Include="System.Net.Http" />
54+
<Reference Include="System.Xml" />
55+
</ItemGroup>
56+
<ItemGroup>
57+
<Compile Include="Entities\Entity.cs" />
58+
<Compile Include="Entities\EntityData.cs" />
59+
<Compile Include="Entities\EntityReading.cs" />
60+
<Compile Include="Entities\EntityReadingValue.cs" />
61+
<Compile Include="Program.cs" />
62+
<Compile Include="Properties\AssemblyInfo.cs" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<None Include="App.config" />
66+
<None Include="packages.config" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<ProjectReference Include="..\..\src\System.Linq.Dynamic.Core\System.Linq.Dynamic.Core.csproj">
70+
<Project>{d3804228-91f4-4502-9595-39584e510002}</Project>
71+
<Name>System.Linq.Dynamic.Core</Name>
72+
</ProjectReference>
73+
</ItemGroup>
74+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
75+
<Import Project="..\..\packages\Microsoft.Azure.DocumentDB.2.5.1\build\Microsoft.Azure.DocumentDB.targets" Condition="Exists('..\..\packages\Microsoft.Azure.DocumentDB.2.5.1\build\Microsoft.Azure.DocumentDB.targets')" />
76+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
77+
<PropertyGroup>
78+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
79+
</PropertyGroup>
80+
<Error Condition="!Exists('..\..\packages\Microsoft.Azure.DocumentDB.2.5.1\build\Microsoft.Azure.DocumentDB.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Azure.DocumentDB.2.5.1\build\Microsoft.Azure.DocumentDB.targets'))" />
81+
</Target>
82+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
3+
namespace ConsoleAppCosmosDb.Entities
4+
{
5+
[Serializable]
6+
public class Entity
7+
{
8+
public Guid Id { get; set; }
9+
public EntityData Data { get; set; }
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace ConsoleAppCosmosDb.Entities
5+
{
6+
[Serializable]
7+
public class EntityData
8+
{
9+
public IList<EntityReading> Readings { get; set; }
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace ConsoleAppCosmosDb.Entities
4+
{
5+
[Serializable]
6+
public class EntityReading
7+
{
8+
public string Status { get; set; }
9+
public int Weight { get; set; }
10+
public EntityReadingValue Value { get; set; }
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
3+
namespace ConsoleAppCosmosDb.Entities
4+
{
5+
[Serializable]
6+
public class EntityReadingValue
7+
{
8+
public int Weight { get; set; }
9+
}
10+
}

0 commit comments

Comments
 (0)