File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 99using Microsoft . Extensions . Logging ;
1010using System . Threading . Tasks ;
1111using System . Linq ;
12+ using Microsoft . Extensions . Configuration ;
13+ using System . IO ;
1214
1315namespace MemcachedTest
1416{
@@ -19,6 +21,8 @@ public abstract class MemcachedClientTest
1921
2022 protected virtual MemcachedClient GetClient ( MemcachedProtocol protocol = MemcachedProtocol . Binary , bool useBinaryFormatterTranscoder = false )
2123 {
24+ var configuration = new ConfigurationBuilder ( ) . Build ( ) ;
25+
2226 IServiceCollection services = new ServiceCollection ( ) ;
2327 services . AddEnyimMemcached ( options =>
2428 {
@@ -29,11 +33,12 @@ protected virtual MemcachedClient GetClient(MemcachedProtocol protocol = Memcach
2933 // options.Transcoder = "BinaryFormatterTranscoder";
3034 //}
3135 } ) ;
32- if ( useBinaryFormatterTranscoder )
36+ if ( useBinaryFormatterTranscoder )
3337 {
34- services . AddSingleton < ITranscoder , BinaryFormatterTranscoder > ( ) ;
38+ services . AddSingleton < ITranscoder , BinaryFormatterTranscoder > ( ) ;
3539 }
3640
41+ services . AddSingleton < IConfiguration > ( configuration ) ;
3742 services . AddLogging ( builder => builder . SetMinimumLevel ( LogLevel . Error ) . AddConsole ( ) ) ;
3843
3944 IServiceProvider serviceProvider = services . BuildServiceProvider ( ) ;
You can’t perform that action at this time.
0 commit comments