using LibGit2Sharp; using System; // Open repository using (var repo = new Repository("path/to/repository")) { // Perform actions on the repository // ... // Dispose of the repository when done repo.Dispose(); }
using LibGit2Sharp; using System; // Open repository using (var repo = new Repository("path/to/repository")) { // Perform actions on the repository // ... } // Repository is automatically disposed when using statement is exitedIn both examples, the Repository.Dispose method is called either manually or automatically when the Repository object is no longer needed. The package library for LibGit2Sharp is "LibGit2Sharp" and can be found in NuGet.
public Dispose ( ) : void | ||
return | void |