Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,16 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk

# Build results
[Dd]ebug/
[Rr]elease/
[Bb]in/
[Oo]bj/
[Oo]utput*/
packages/
# Visual Studio
.vs/
_NCrunch*/
*.ncrunchsolution
*.user
23 changes: 0 additions & 23 deletions OdpNetMicroMapper.nuspec

This file was deleted.

25 changes: 21 additions & 4 deletions OdpNetMicroMapper.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OdpNetMicroMapper", "OdpNetMicroMapper\OdpNetMicroMapper.csproj", "{A18AC73A-2B4B-4D66-BF15-1094CBEDCC1F}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OdpNetMicroMapper", "OdpNetMicroMapper\OdpNetMicroMapper.csproj", "{A18AC73A-2B4B-4D66-BF15-1094CBEDCC1F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{CC7CDBB4-E507-4558-A7DE-9800D19624D7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{CC7CDBB4-E507-4558-A7DE-9800D19624D7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestManagedCore", "TestManagedCore\TestManagedCore.csproj", "{E11DFADB-53F1-463A-AE18-5BC65C8EAD26}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestManaged", "TestManaged\TestManaged.csproj", "{A7BDAEAC-FB26-4BCA-AF89-A4C14C0E3A9B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -19,8 +25,19 @@ Global
{CC7CDBB4-E507-4558-A7DE-9800D19624D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC7CDBB4-E507-4558-A7DE-9800D19624D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC7CDBB4-E507-4558-A7DE-9800D19624D7}.Release|Any CPU.Build.0 = Release|Any CPU
{E11DFADB-53F1-463A-AE18-5BC65C8EAD26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E11DFADB-53F1-463A-AE18-5BC65C8EAD26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E11DFADB-53F1-463A-AE18-5BC65C8EAD26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E11DFADB-53F1-463A-AE18-5BC65C8EAD26}.Release|Any CPU.Build.0 = Release|Any CPU
{A7BDAEAC-FB26-4BCA-AF89-A4C14C0E3A9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7BDAEAC-FB26-4BCA-AF89-A4C14C0E3A9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7BDAEAC-FB26-4BCA-AF89-A4C14C0E3A9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7BDAEAC-FB26-4BCA-AF89-A4C14C0E3A9B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B4FE17EF-B531-4D60-B63F-F4980F422F8D}
EndGlobalSection
EndGlobal
25 changes: 12 additions & 13 deletions OdpNetMicroMapper/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,40 @@ namespace OdpNetMicroMapper
{
public class Connection : IDisposable
{
int level = 0;
IDbConnection connection;
DbMapper orm;
private int _level;
private readonly IDbConnection _connection;
private readonly DbMapper _orm;
public IDbConnection GetAdoConnection()
{
return connection;
return _connection;
}

public Connection(DbMapper orm, IDbConnection connection)
{
this.orm = orm;
this.connection = connection;
_orm = orm;
_connection = connection;
}

public void NextLevel()
{
level++;
_level++;
}

public IDbTransaction BeginTransaction()
{
return connection.BeginTransaction();
return _connection.BeginTransaction();
}


public void Dispose()
{
if (level == 0)
if (_level == 0)
{
connection.Dispose();
orm.ReleaseConnection();
_connection.Dispose();
_orm.ReleaseConnection();
}
else
{
level--;
_level--;
}
}
}
Expand Down
Loading