Skip to content

Commit 100cd77

Browse files
JinhuafeiHongGit
authored andcommitted
A provider for cosmosDB (#3)
* v1 * fixing concurrent requests bugs, moving secrets to appsettings and nupkg * add partition support * fix several bugs * delete unnecessary file * update according to CR * fix timeout unit issue * update nupkg dependency * fix IsNewSession in cookieless mode
1 parent 1630641 commit 100cd77

File tree

35 files changed

+1852
-576
lines changed

35 files changed

+1852
-576
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
.vs/
44
msbuild.*
55
obj/
6-
packages/
6+
/packages/

Microsoft.Aspnet.SessionState.sln

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26430.16
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{58E8143E-86D8-4CA3-AAC3-1CF253D91207}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{93AD624B-85A6-4EE9-B40E-42914D40C0CF}"
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync", "src\SqlSessionStateProviderAsync\Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync.csproj", "{493B0482-572A-4465-BD52-4094351C2647}"
1111
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SessionState.CosmosDBSessionStateProviderAsync", "src\CosmosDBSessionStateProviderAsync\Microsoft.AspNet.SessionState.CosmosDBSessionStateProviderAsync.csproj", "{4CFB2896-D5C1-4E96-A3DA-D57C58539209}"
13+
EndProject
1214
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SessionState.SessionStateModule", "src\SessionStateModule\Microsoft.AspNet.SessionState.SessionStateModule.csproj", "{7238F90D-3BCE-4F40-A5BA-EA36AD484BD6}"
1315
EndProject
1416
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync.Test", "test\Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync.Test\Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync.Test.csproj", "{CBB00B6C-8A44-43F0-BE73-0B0E8565F8A2}"
@@ -22,7 +24,10 @@ Global
2224
{493B0482-572A-4465-BD52-4094351C2647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2325
{493B0482-572A-4465-BD52-4094351C2647}.Debug|Any CPU.Build.0 = Debug|Any CPU
2426
{493B0482-572A-4465-BD52-4094351C2647}.Release|Any CPU.ActiveCfg = Release|Any CPU
25-
{493B0482-572A-4465-BD52-4094351C2647}.Release|Any CPU.Build.0 = Release|Any CPU
27+
{4CFB2896-D5C1-4E96-A3DA-D57C58539209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28+
{4CFB2896-D5C1-4E96-A3DA-D57C58539209}.Debug|Any CPU.Build.0 = Debug|Any CPU
29+
{4CFB2896-D5C1-4E96-A3DA-D57C58539209}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{4CFB2896-D5C1-4E96-A3DA-D57C58539209}.Release|Any CPU.Build.0 = Release|Any CPU
2631
{7238F90D-3BCE-4F40-A5BA-EA36AD484BD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2732
{7238F90D-3BCE-4F40-A5BA-EA36AD484BD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
2833
{7238F90D-3BCE-4F40-A5BA-EA36AD484BD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -37,6 +42,7 @@ Global
3742
EndGlobalSection
3843
GlobalSection(NestedProjects) = preSolution
3944
{493B0482-572A-4465-BD52-4094351C2647} = {58E8143E-86D8-4CA3-AAC3-1CF253D91207}
45+
{4CFB2896-D5C1-4E96-A3DA-D57C58539209} = {58E8143E-86D8-4CA3-AAC3-1CF253D91207}
4046
{7238F90D-3BCE-4F40-A5BA-EA36AD484BD6} = {58E8143E-86D8-4CA3-AAC3-1CF253D91207}
4147
{CBB00B6C-8A44-43F0-BE73-0B0E8565F8A2} = {93AD624B-85A6-4EE9-B40E-42914D40C0CF}
4248
EndGlobalSection

MicrosoftAspNetSessionState.msbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<ItemGroup>
55
<AssemblyProject Include="src\SessionStateModule\Microsoft.AspNet.SessionState.SessionStateModule.csproj" />
66
<AssemblyProject Include="src\SqlSessionStateProviderAsync\Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync.csproj" />
7+
<AssemblyProject Include="src\CosmosDBSessionStateProviderAsync\Microsoft.AspNet.SessionState.CosmosDBSessionStateProviderAsync.csproj" />
78
</ItemGroup>
89
<ItemGroup Condition="'$(BuildCoreOnly)' != 'true'">
910
<AssemblyProject Include="test\Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync.Test\Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync.Test.csproj" />

src/CosmosDBSessionStateProviderAsync/CosmosDBSessionStateProviderAsync.cs

Lines changed: 1153 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.Aspnet.SessionState.sln))\tools\CosmosDBSessionStateProviderAsync.settings.targets" />
5+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.Aspnet.SessionState.sln))\tools\MicrosoftAspNetSessionState.settings.targets" />
6+
<PropertyGroup>
7+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9+
<ProjectGuid>{4CFB2896-D5C1-4E96-A3DA-D57C58539209}</ProjectGuid>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<RootNamespace>Microsoft.AspNet.SessionStateCosmosDBSessionStateProviderAsync</RootNamespace>
13+
<AssemblyName>Microsoft.AspNet.SessionState.CosmosDBSessionStateProviderAsync</AssemblyName>
14+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
15+
<FileAlignment>512</FileAlignment>
16+
<TargetFrameworkProfile />
17+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
18+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21+
<DebugSymbols>true</DebugSymbols>
22+
<DebugType>full</DebugType>
23+
<Optimize>false</Optimize>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
<BaseIntermediateOutputPath>..\obj\</BaseIntermediateOutputPath>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
<BaseIntermediateOutputPath>..\obj\</BaseIntermediateOutputPath>
36+
</PropertyGroup>
37+
<PropertyGroup>
38+
<SignAssembly>true</SignAssembly>
39+
</PropertyGroup>
40+
<PropertyGroup>
41+
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
42+
</PropertyGroup>
43+
<PropertyGroup>
44+
<DelaySign>true</DelaySign>
45+
</PropertyGroup>
46+
<ItemGroup>
47+
<Reference Include="Microsoft.Azure.Documents.Client, Version=1.15.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
48+
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.1.15.0\lib\net45\Microsoft.Azure.Documents.Client.dll</HintPath>
49+
</Reference>
50+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
51+
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
52+
</Reference>
53+
<Reference Include="System" />
54+
<Reference Include="System.Configuration" />
55+
<Reference Include="System.Core" />
56+
<Reference Include="System.Web" />
57+
<Reference Include="System.Xml.Linq" />
58+
<Reference Include="System.Data.DataSetExtensions" />
59+
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="System.Data" />
61+
<Reference Include="System.Net.Http" />
62+
<Reference Include="System.Xml" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="CosmosDBSessionStateProviderAsync.cs" />
66+
<Compile Include="SessionStateActionsConverter.cs" />
67+
<Compile Include="TimeSpanConverter.cs" />
68+
<Compile Include="Properties\AssemblyInfo.cs" />
69+
<Compile Include="Resources\SR.Designer.cs">
70+
<AutoGen>True</AutoGen>
71+
<DesignTime>True</DesignTime>
72+
<DependentUpon>SR.resx</DependentUpon>
73+
</Compile>
74+
<Compile Include="SessionStateItem.cs" />
75+
</ItemGroup>
76+
<ItemGroup>
77+
<ProjectReference Include="..\SessionStateModule\Microsoft.AspNet.SessionState.SessionStateModule.csproj">
78+
<Project>{7238f90d-3bce-4f40-a5ba-ea36ad484bd6}</Project>
79+
<Name>Microsoft.AspNet.SessionState.SessionStateModule</Name>
80+
</ProjectReference>
81+
</ItemGroup>
82+
<ItemGroup>
83+
<None Include="packages.config" />
84+
</ItemGroup>
85+
<ItemGroup>
86+
<EmbeddedResource Include="Resources\SR.resx">
87+
<Generator>ResXFileCodeGenerator</Generator>
88+
<LastGenOutput>SR.Designer.cs</LastGenOutput>
89+
</EmbeddedResource>
90+
</ItemGroup>
91+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
92+
<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')" />
93+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
94+
<PropertyGroup>
95+
<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>
96+
</PropertyGroup>
97+
<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'))" />
98+
</Target>
99+
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Microsoft.AspNet.SessionState.CosmosDBSessionStateProviderAsync")]
9+
[assembly: AssemblyDescription("Microsoft.AspNet.SessionState.CosmosDBSessionStateProviderAsync.dll")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Microsoft Corporation")]
12+
[assembly: AssemblyProduct("Microsoft AspNet Async CosmosDBSessionStateProvider")]
13+
[assembly: AssemblyCopyright("\x00a9 Microsoft Corporation. All rights reserved.")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("4cfb2896-d5c1-4e96-a3da-d57c58539209")]
24+

src/CosmosDBSessionStateProviderAsync/Resources/SR.Designer.cs

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

0 commit comments

Comments
 (0)