Using ApplicationDB in an extension class method

This example shows how to use ApplicationDB in an extension class:

public int MyMethod() 
{ 
   using (ApplicationDB appDB = this.CreateApplicationDB()) 
   { 
      // Use appDB here... 
   } 
} 
Note: The ApplicationDB instance is created as part of the Using…End Using block. This ensures that the ApplicationDB instance is disposed of and any resources it is holding are released as soon as the instance goes out of scope. For more information on the Using statement, see the .NET Framework documentation.