Converting a VB.NET Common Function in C #

I used a converter program to convert this vb to c #

Public Overloads Shared Function ExecuteReader(ByVal statement As String, ByVal commandType As CommandType, _
    ByVal paramCollection As ArrayList, ByVal connectionDelegate As OpenDatabaseConnection, _
    ByVal outputConnectionObject As IDbConnection, ByVal CommandTimeout As Int16) As InstantASP.Common.Data.IDataReader

Return PrivateExecuteReader(Configuration.AppSettings.DataProvider, _
    statement, commandType, paramCollection, connectionDelegate, outputConnectionObject, CommandTimeout)

End Function

I am not familiar with VB.NET, and I do not know why this converter converted it to C # with all these links. I don't even use ref much, if at all, and I don't think this is the best / cleanest way to convert this. But it’s hard for me to understand all this, including the conversion, and if it makes sense after the conversion.

public static IDataReader ExecuteReader(string statement, CommandType commandType, ArrayList paramCollection, OpenDatabaseConnection connectionDelegate, IDbConnection outputConnectionObject, Int16 commandTimeout)
{
    return PrivateExecuteReader(ref AppSettings.DataProvider(), ref statement,
        ref commandType, ref paramCollection, ref connectionDelegate,
        ref outputConnectionObject, ref commandTimeout);
}
+3
source share
1 answer

It puts refin these parameters because it PrivateExecuteReader()declares them as ref(C #) or ByRef(VB.NET). No choice.

VB.NET ( Intellisense), , . #, ref, , ref, , , .

[] .

+5

All Articles