我有两个课程xCustomer
和xProduct
Case Tables.xCustomer
Dim Count As Integer = (From t In New XPQuery(Of xCustomer)(DefaultSession) Select t.CustomerID).Count
Return Count + 1
Case Tables.xProduct
Dim Count As Integer = (From t In New XPQuery(Of xProduct)(DefaultSession) Select t.ProductID).Count
Return Count + 1
如何通过使用字符串转换类来简化上述语句?
例如,我想使用像
这样的东西Dim Test as object
Test = ReturnClassOfString(“xCustomer”)
答案 0 :(得分:1)