Ejemplo n.º 1
0
        private static void ConstructAndFreeUpReferenceButDevIsPlaingWithGC()
        {
            var db = new DbProviderMock();

            db.Dispose();
            GC.ReRegisterForFinalize(db);
        }
Ejemplo n.º 2
0
 private static void ConstructAndFreeUpReferenceWithUsing()
 {
     using (var db = new DbProviderMock())
     {
         db.ToString(); // and any other method invoking for implement any bussines logic
     } // Implicite invoking Dispose() in the place 'currly bracket'. Possible only with IDisposable implementation
 }