Skip to content

Commit 6bbd98d

Browse files
Changed to use Cosmos DB .NET SDK v3 (#60)
* Changed to use Cosmos DB .NET SDK v3 * Rename `collection` to `container` according to the latest naming convention * Drop partition options entirely. Still accept 'collectionId' for compat. Also revved down the Cosmos SDK version a bit to not force people into upgrading if they have older dependencies. (Probably not for the Cosmos SDK specifically, but requiring a minimum of 1.3 instead of 1.19 for dependencies like Azure.Core is reasonable. It does not prevent folks from using newer versions if they want.) --------- Co-authored-by: Steve Molloy <[email protected]>
1 parent 402c076 commit 6bbd98d

File tree

9 files changed

+708
-819
lines changed

9 files changed

+708
-819
lines changed

src/CosmosDBSessionStateProviderAsync/CosmosDBSessionStateProviderAsync.cs

Lines changed: 95 additions & 297 deletions
Large diffs are not rendered by default.

src/CosmosDBSessionStateProviderAsync/Microsoft.AspNet.SessionState.CosmosDBSessionStateProviderAsync.csproj

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<TargetFrameworkProfile />
1616
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
1717
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
18+
<NuGetPackageImportStamp>
19+
</NuGetPackageImportStamp>
1820
</PropertyGroup>
1921
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2022
<DebugSymbols>true</DebugSymbols>
@@ -43,22 +45,23 @@
4345
<DelaySign>true</DelaySign>
4446
</PropertyGroup>
4547
<ItemGroup>
46-
<Reference Include="Microsoft.Azure.Documents.Client, Version=1.15.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
47-
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.1.15.0\lib\net45\Microsoft.Azure.Documents.Client.dll</HintPath>
48-
</Reference>
49-
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
50-
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
51-
</Reference>
5248
<Reference Include="System" />
5349
<Reference Include="System.Configuration" />
5450
<Reference Include="System.Core" />
51+
<Reference Include="System.Data.OracleClient" />
52+
<Reference Include="System.Net" />
53+
<Reference Include="System.Numerics" />
54+
<Reference Include="System.Security" />
55+
<Reference Include="System.ServiceProcess" />
56+
<Reference Include="System.Transactions" />
5557
<Reference Include="System.Web" />
5658
<Reference Include="System.Xml.Linq" />
5759
<Reference Include="System.Data.DataSetExtensions" />
5860
<Reference Include="Microsoft.CSharp" />
5961
<Reference Include="System.Data" />
6062
<Reference Include="System.Net.Http" />
6163
<Reference Include="System.Xml" />
64+
<Reference Include="WindowsBase" />
6265
</ItemGroup>
6366
<ItemGroup>
6467
<Compile Include="CosmosDBSessionStateProviderAsync.cs" />
@@ -78,21 +81,16 @@
7881
<Name>Microsoft.AspNet.SessionState.SessionStateModule</Name>
7982
</ProjectReference>
8083
</ItemGroup>
81-
<ItemGroup>
82-
<None Include="packages.config" />
83-
</ItemGroup>
8484
<ItemGroup>
8585
<EmbeddedResource Include="Resources\SR.resx">
8686
<Generator>ResXFileCodeGenerator</Generator>
8787
<LastGenOutput>SR.Designer.cs</LastGenOutput>
8888
</EmbeddedResource>
8989
</ItemGroup>
90+
<ItemGroup>
91+
<PackageReference Include="Microsoft.Azure.Cosmos">
92+
<Version>3.23.0</Version>
93+
</PackageReference>
94+
</ItemGroup>
9095
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
91-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
92-
<PropertyGroup>
93-
<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>
94-
</PropertyGroup>
95-
<Error Condition="!Exists('..\..\packages\Microsoft.Azure.DocumentDB.1.15.0\build\Microsoft.Azure.DocumentDB.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Azure.DocumentDB.1.15.0\build\Microsoft.Azure.DocumentDB.targets'))" />
96-
</Target>
97-
<Import Project="..\..\packages\Microsoft.Azure.DocumentDB.1.15.0\build\Microsoft.Azure.DocumentDB.targets" Condition="Exists('..\..\packages\Microsoft.Azure.DocumentDB.1.15.0\build\Microsoft.Azure.DocumentDB.targets')" />
9896
</Project>

src/CosmosDBSessionStateProviderAsync/Resources/SR.Designer.cs

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CosmosDBSessionStateProviderAsync/Resources/SR.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@
120120
<data name="ArgumentNull_WithParamName" xml:space="preserve">
121121
<value>Parameter '{0}' cannot be null.</value>
122122
</data>
123-
<data name="Cant_use_id_for_partition_key" xml:space="preserve">
124-
<value>The value '{0}' is invalid for 'partitionKeyPath' when not using wildcard partitioning.</value>
123+
<data name="Container_PKey_Does_Not_Match" xml:space="preserve">
124+
<value>The specified container '{0}' already exists with a partition key path other than '{1}'.</value>
125125
</data>
126126
<data name="EmptyConfig_WithName" xml:space="preserve">
127127
<value>Configuration '{0}' cannot be null.</value>

src/CosmosDBSessionStateProviderAsync/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)