public static IResponse ProcessOperation(int operation, XdrStream xdr) { switch (operation) { case IscCodes.op_response: return(new GenericResponse( xdr.ReadInt32(), xdr.ReadInt64(), xdr.ReadBuffer(), xdr.ReadStatusVector())); case IscCodes.op_fetch_response: return(new FetchResponse(xdr.ReadInt32(), xdr.ReadInt32())); case IscCodes.op_sql_response: return(new SqlResponse(xdr.ReadInt32())); case IscCodes.op_trusted_auth: return(new AuthResponse(xdr.ReadBuffer())); case IscCodes.op_crypt_key_callback: return(new CryptKeyCallbackResponse(xdr.ReadBuffer())); default: throw new ArgumentOutOfRangeException(nameof(operation), $"{nameof(operation)}={operation}"); } }
public static IResponse ProcessOperation(int operation, XdrStream xdr) { switch (operation) { case IscCodes.op_response: return(new GenericResponse( xdr.ReadInt32(), xdr.ReadInt64(), xdr.ReadBuffer(), xdr.ReadStatusVector())); case IscCodes.op_fetch_response: return(new FetchResponse(xdr.ReadInt32(), xdr.ReadInt32())); case IscCodes.op_sql_response: return(new SqlResponse(xdr.ReadInt32())); case IscCodes.op_trusted_auth: return(new AuthResponse(xdr.ReadBuffer())); case IscCodes.op_crypt_key_callback: return(new CryptKeyCallbackReponse(xdr.ReadBuffer())); default: return(null); } }