我是 c# 新手,很难弄清楚这一点,
public UserNotificationFeed GetNotificationFeed(TenantInfo tenant, List<int> notificationId)
{
UserNotificationFeed userNotificationFeed = new UserNotificationFeed();
string sql = "select " + NotificationFieldList + " from UserNotificationFeed where MsgId = @MsgId";
Database databaseObj = SocialDB.GetDataBase(tenant.ConnectionString, tenant.ProviderName);
DbCommand commandObj = databaseObj.GetSqlStringCommand(sql);
databaseObj.AddInParameter(commandObj, "MsgId", DbType.Int64, notificationId );
using (IDataReader reader = databaseObj.ExecuteReader(commandObj))
{
while (reader.Read())
{
userNotificationFeed = new UserNotificationFeed();
this.PopulateObject(userNotificationFeed, reader);
}
}
return userNotificationFeed;
}
我想要的是
string sql = "select " + NotificationFieldList + " from UserNotificationFeed where MsgId = @MsgId";
获取MsgId
由 a 传递的 s列表List<int> notificationId
。
非常感谢任何帮助。