我试过如下
var Settings = new RedisSettings("localhost");
public async void SetData< T >(IEnumerable< T > collection, string Key)
{
RedisDictionary< object, T > mydictionary = new RedisDictionary< object, T >(Settings, typeof(T).Name);
//how to add collection data into dictionary
// i tried like following but failed
await mydictionary.Set(new[] { new KeyValuePair< object, IEnumerable< T > >(Key, collection) });
但它无法将值插入redis字典:(我用过