Original Source Code
[ProcMethod("TestRetrieveAllTypes")] public void TestRetrieveAllTypes() { IDbConnection conn = ProcCallContext.Current.GetConnection("Turtleneck"); IDbCommand command = conn.CreateCommand(); command.CommandType = CommandType.Text; command.CommandText = "select * from TestAllTypesTable"; SqlResultSet rs = new SqlResultSet(command); ProcCallContext.Current.SetReturnData(rs); }Disassembled code output by ILDASM.exe
.method public hidebysig instance void TestRetrieveAllTypes() cil managed { .custom instance void Turtleneck.ProcSupport.ProcMethodAttribute::.ctor(string) = ( 01 00 14 54 65 73 74 52 65 74 72 69 65 76 65 41 // ...TestRetrieveA 6C 6C 54 79 70 65 73 00 00 ) // llTypes.. // Code size 60 (0x3c) .maxstack 2 .locals init (class [System.Data]System.Data.IDbConnection V_0, class [System.Data]System.Data.IDbCommand V_1, class Turtleneck.ProcSupport.SqlResultSet V_2) IL_0000: call class Turtleneck.ProcSupport.ProcCallContext Turtleneck.ProcSupport.ProcCallContext::get_Current() IL_0005: ldstr "Turtleneck" IL_000a: callvirt instance class [System.Data]System.Data.IDbConnection Turtleneck.ProcSupport.ProcCallContext::GetConnection(string) IL_000f: stloc.0 IL_0010: ldloc.0 IL_0011: callvirt instance class [System.Data]System.Data.IDbCommand [System.Data]System.Data.IDbConnection::CreateCommand() IL_0016: stloc.1 IL_0017: ldloc.1 IL_0018: ldc.i4.1 IL_0019: callvirt instance void [System.Data]System.Data.IDbCommand::set_CommandType(valuetype [System.Data]System.Data.CommandType) IL_001e: ldloc.1 IL_001f: ldstr "select * from TestAllTypesTable" IL_0024: callvirt instance void [System.Data]System.Data.IDbCommand::set_CommandText(string) IL_0029: ldloc.1 IL_002a: newobj instance void Turtleneck.ProcSupport.SqlResultSet::.ctor(class [System.Data]System.Data.IDbCommand) IL_002f: stloc.2 IL_0030: call class Turtleneck.ProcSupport.ProcCallContext Turtleneck.ProcSupport.ProcCallContext::get_Current() IL_0035: ldloc.2 IL_0036: callvirt instance void Turtleneck.ProcSupport.ProcCallContext::SetReturnData(class Turtleneck.ProcSupport.ResultSet.IResultSet) IL_003b: ret } // end of method TestProc::TestRetrieveAllTypes