2016-08-02 86 views
0

我嘗試配置RedisManagerPool。 RedisManagerPool有3個構造函數,但我無法用一個字符串參數(主機)設置構造函數。 它被調用必須提供至少例外。無法使用一個參數配置構造函數

它是代碼作品,在評論破碎的代碼。

var host = CloudConfigurationManager.GetSetting("Data.Redis.ConnectionString"); 
var list = new List<string>() {host}; 
//TODO: Can't setup constructor with host parameter. I don't the reason. 
//For<IRedisClientsManager>() 
// .Add<RedisManagerPool>() 
// .Ctor<string>("host").Is(host); 
For<IRedisClientsManager>() 
.Add<RedisManagerPool>() 
.Ctor<IEnumerable<string>>("hosts").Is(list); 
+0

嘗試'。是((IEnumerable的)名單)' – Kalten

回答

0

我認爲你需要使用使用代替添加

For<IRedisClientsManager>() 
.Use<RedisManagerPool>() 
.Ctor<IEnumerable<string>>("hosts").Is(list); 
相關問題