コード例 #1
0
 /// <summary>
 /// 添加<see cref="IServiceDiscovery"/>
 /// </summary>
 /// <typeparam name="TServiceDiscovery"></typeparam>
 /// <param name="feignBuilder"></param>
 /// <returns></returns>
 public static IFeignBuilder AddServiceDiscovery <TServiceDiscovery>(this IFeignBuilder feignBuilder) where TServiceDiscovery : IServiceDiscovery
 {
     feignBuilder.AddOrUpdateService(typeof(IServiceDiscovery), typeof(TServiceDiscovery), FeignClientLifetime.Singleton);
     return(feignBuilder);
 }
コード例 #2
0
 /// <summary>
 /// 添加<see cref="ICacheProvider"/>
 /// </summary>
 /// <typeparam name="TCacheProvider"></typeparam>
 /// <param name="feignBuilder"></param>
 /// <returns></returns>
 public static IFeignBuilder AddCacheProvider <TCacheProvider>(this IFeignBuilder feignBuilder) where TCacheProvider : ICacheProvider
 {
     feignBuilder.AddOrUpdateService(typeof(ICacheProvider), typeof(TCacheProvider), FeignClientLifetime.Singleton);
     return(feignBuilder);
 }
コード例 #3
0
 /// <summary>
 /// 添加<see cref="ILoggerFactory"/>
 /// </summary>
 /// <typeparam name="TLoggerFactory"></typeparam>
 /// <param name="feignBuilder"></param>
 /// <returns></returns>
 public static IFeignBuilder AddLoggerFactory <TLoggerFactory>(this IFeignBuilder feignBuilder) where TLoggerFactory : ILoggerFactory
 {
     feignBuilder.AddOrUpdateService(typeof(ILoggerFactory), typeof(TLoggerFactory), FeignClientLifetime.Singleton);
     return(feignBuilder);
 }