Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4a27406

Browse filesBrowse files
Samuel CorderSamuel Corder
Samuel Corder
authored and
Samuel Corder
committed
Added IDisposable interface to Mongo object.
1 parent 658d2be commit 4a27406
Copy full SHA for 4a27406

File tree

1 file changed

+6
-1
lines changed
Filter options

1 file changed

+6
-1
lines changed

‎MongoDBDriver/Mongo.cs

Copy file name to clipboardExpand all lines: MongoDBDriver/Mongo.cs
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace MongoDB.Driver
1313
/// <summary>
1414
/// Description of Mongo.
1515
/// </summary>
16-
public class Mongo
16+
public class Mongo : IDisposable
1717
{
1818
private Connection connection;
1919

@@ -74,5 +74,10 @@ public Boolean Disconnect(){
7474
connection.Close();
7575
return connection.State == ConnectionState.Closed;
7676
}
77+
78+
public void Dispose (){
79+
this.Disconnect();
80+
}
81+
7782
}
7883
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.