作为一个整体,我是 C# 的新手,想知道如何实现下面描述的功能。目前,这不是在指定的行编译。我想要代码做的是:
遍历每个KVP,使用keystring作为表名查询db 返回列表
var dbCon = dbConnectionFactory.OpenDbConnection();
Dictionary<string, Type> ibetDic = getFromSomeWhere();
foreach (KeyValuePair<string, Type> entry in ibetDic)
{
Type type = entry.Value;
var typedRedisClient = redis.GetTypedClient<type>();/*not compiling here*/
String sql = "USE ibet SELECT * FROM " + entry.Key;
var itemList = dbCon.SqlList<type>(sql);/*not compiling here*/
foreach (var tableRow in itemList )
{
//store with redistypedclient
}
}