Skip to content

Commit

Permalink
Merge pull request #10 from sakopov/dapper-update-and-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sakopov authored Mar 17, 2019
2 parents 3b24435 + 7b9ce0b commit 11b9f74
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 66 deletions.
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ after_build:
}
test_script:
- dotnet test "test\Dapper.AmbientContext.Tests\Dapper.AmbientContext.Tests.csproj" -c %CONFIGURATION%
- dotnet test "test\Dapper.AmbientContext.Tests\Dapper.AmbientContext.Tests.csproj" --no-build --no-restore -c %CONFIGURATION% -f net452 -a %USERPROFILE%\.nuget\packages\machine.specifications.runner.visualstudio\2.8.0
- dotnet test "test\Dapper.AmbientContext.Tests\Dapper.AmbientContext.Tests.csproj" --no-build --no-restore -c %CONFIGURATION% -f netcoreapp2.1

#---------------------------------#
# artifacts configuration #
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SimpleInjector" Version="4.3.0" />
<PackageReference Include="SimpleInjector" Version="4.4.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Dapper.AmbientContext\Dapper.AmbientContext.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Data.SqlClient">
<HintPath>..\..\..\..\..\Users\sakopov\.nuget\packages\system.data.sqlclient\4.4.0\ref\netstandard1.3\System.Data.SqlClient.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Dapper.AmbientContext/Dapper.AmbientContext.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Ambient context implementation for Dapper.NET</Description>
<Copyright>Copyright Sergey Akopov</Copyright>
<VersionPrefix>1.6.0</VersionPrefix>
<VersionPrefix>1.7.0</VersionPrefix>
<Authors>Sergey Akopov</Authors>
<TargetFrameworks>net451;netstandard1.3;netstandard2.0</TargetFrameworks>
<AssemblyName>Dapper.AmbientContext</AssemblyName>
Expand All @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="1.50.5" />
<PackageReference Include="Dapper" Version="1.60.1" />
<PackageReference Include="System.Collections.Immutable" Version="1.5.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class When_calling_create_with_none_closed_database_connection
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -56,7 +56,7 @@ class When_calling_create_with_closed_database_connection
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class When_ambient_database_context_stack_is_empty
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -48,7 +48,7 @@ class When_ambient_database_context_stack_has_one_ambient_database_context
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -89,7 +89,7 @@ class When_ambient_database_context_stack_has_more_than_one_ambient_database_con
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class When_getting_storage_after_it_has_been_set
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down
40 changes: 20 additions & 20 deletions test/Dapper.AmbientContext.Tests/AmbientDbContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class When_creating_first_ambient_database_context_with_transaction_suppression_
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -69,7 +69,7 @@ class When_creating_multiple_joined_ambient_database_contexts_with_transaction_s
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -131,7 +131,7 @@ class When_creating_disjoined_ambient_database_contexts_with_transaction_suppres
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -194,7 +194,7 @@ class When_disposing_single_ambient_database_context
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -252,7 +252,7 @@ class When_disposing_single_ambient_database_context_without_explicit_commit
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -328,7 +328,7 @@ class When_disposing_multiple_joined_ambient_database_contexts
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -408,7 +408,7 @@ class When_disposing_multiple_disjoined_ambient_database_contexts
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -488,7 +488,7 @@ class When_disposing_multiple_joined_ambient_database_contexts_out_of_order
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -582,7 +582,7 @@ class When_committing_single_ambient_database_context_without_suppressed_transac
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -650,7 +650,7 @@ class When_committing_single_ambient_database_context_without_suppressed_transac
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -711,7 +711,7 @@ class When_committing_single_ambient_database_context_with_suppressed_transactio
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -767,7 +767,7 @@ class When_committing_joined_child_ambient_database_context
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -834,7 +834,7 @@ class When_committing_joined_parent_ambient_database_context
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -902,7 +902,7 @@ class When_the_joined_parent_ambient_database_context_requests_connection_first
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -964,7 +964,7 @@ class When_the_joined_child_ambient_database_context_requests_connection_first
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -1030,7 +1030,7 @@ class When_rolling_back_single_ambient_database_context_without_suppressed_trans
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -1091,7 +1091,7 @@ class When_rolling_back_single_ambient_database_context_with_suppressed_transact
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -1147,7 +1147,7 @@ class When_rolling_back_joined_child_ambient_database_context
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -1214,7 +1214,7 @@ class When_rolling_back_joined_parent_ambient_database_context
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -1282,7 +1282,7 @@ class When_rolling_back_single_ambient_database_context_without_suppressed_trans
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class When_initializing_contextual_storage_helper
{
Establish context = () =>
{
#if NET451
#if NET452
_storage = new LogicalCallContextStorage();
#else
_storage = new AsyncLocalContextStorage();
Expand Down Expand Up @@ -50,7 +50,7 @@ class When_getting_an_empty_ambient_database_context_stack_from_the_contextual_s
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down Expand Up @@ -84,7 +84,7 @@ class When_getting_non_empty_ambient_database_context_stack_from_the_contextual_
{
Establish context = () =>
{
#if NET451
#if NET452
AmbientDbContextStorageProvider.SetStorage(new LogicalCallContextStorage());
#else
AmbientDbContextStorageProvider.SetStorage(new AsyncLocalContextStorage());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp1.1;netcoreapp2.1</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.7.0" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.8.0" />
<PackageReference Include="Machine.Specifications.Should" Version="0.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="Moq" Version="4.9.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Moq" Version="4.10.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Dapper.AmbientContext\Dapper.AmbientContext.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PackageReference Include="Microsoft.NETCore.Platforms" Version="1.1.0" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
Loading

0 comments on commit 11b9f74

Please sign in to comment.