本文整理汇总了C#中Couchbase.Configuration.Client.ClientConfiguration.Converter方法的典型用法代码示例。如果您正苦于以下问题:C# ClientConfiguration.Converter方法的具体用法?C# ClientConfiguration.Converter怎么用?C# ClientConfiguration.Converter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Couchbase.Configuration.Client.ClientConfiguration
的用法示例。
在下文中一共展示了ClientConfiguration.Converter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClusterController
public ClusterController(ClientConfiguration clientConfig)
: this(clientConfig,
pool =>
{
Log.Debug(m => m("Creating DefaultIOStrategy"));
return new DefaultIOStrategy(pool);
},
(config, endpoint) =>
{
IConnectionPool connectionPool;
if (config.UseSsl)
{
connectionPool = new ConnectionPool<SslConnection>(config, endpoint);
}
else
{
connectionPool = new ConnectionPool<Connection>(config, endpoint);
}
connectionPool.Initialize();
return connectionPool;
},
SaslFactory.GetFactory3(),
clientConfig.Converter(),
clientConfig.Transcoder())
{
}
示例2: ClusterController
public ClusterController(ClientConfiguration clientConfig)
: this(clientConfig,
clientConfig.IOServiceCreator,
clientConfig.ConnectionPoolCreator,
clientConfig.CreateSaslMechanism,
clientConfig.Converter(),
clientConfig.Transcoder())
{
}
示例3: GetTranscoder
/// <summary>
/// Gets a Func for creating <see cref="ITypeTranscoder"/> transcoders.
/// </summary>
/// <param name="config">The current <see cref="ClientConfiguration"/>.</param>
/// <param name="typeName">The name of the type implementing <see cref="ITypeTranscoder"/>.</param>
/// <returns>A <see cref="Func{ITypeTranscoder}"/> for creating <see cref="ITypeTranscoder"/>s.</returns>
public static Func<ITypeTranscoder> GetTranscoder(ClientConfiguration config, string typeName)
{
var parameters = new object[]
{
config.Converter(),
config.Serializer()
};
var type = Type.GetType(typeName, true);
return () => (ITypeTranscoder)Activator.CreateInstance(type, parameters);
}
示例4: When_Custom_Converter_Configured_In_AppConfig_It_Is_Returned
public void When_Custom_Converter_Configured_In_AppConfig_It_Is_Returned()
{
var section = (CouchbaseClientSection)ConfigurationManager.GetSection("couchbaseClients/couchbase_2");
var config = new ClientConfiguration(section);
Assert.IsInstanceOf<FakeConverter>(config.Converter());
}