摘要:
一,代码结构如下 二,我们线直接上代码,如下: using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; usi 阅读全文
摘要:
一,接着前面的代码,我们先引用Ocelot.Provider.Polly,然后我们的startup接着配置下,如下 using System; using System.Collections.Generic; using System.Linq; using System.Threading.Ta 阅读全文
摘要:
一。我们用Ocelot加consul一起使用,服务的注册发现,而不是现在的单机版手动配置服务地址 我们写Ocelot的配置,这个是时候 我们要引用Ocelot.Provider.Consul这个包,然后又多一个扩展addConsul()这个扩展方法,如下startup的配置 using System 阅读全文
摘要:
一,引用ocelot,本文测试16版本有BUG,只好使用15.0.7 二,startup的配置,很简单,就是注册和添加管道 using System; using System.Collections.Generic; using System.Linq; using System.Threadin 阅读全文
摘要:
一,我们新建两个项目结构如下:ConsulTestDemo(AP项目)和TestClient(客户端访问调用) 二,我们先写Consul的接口注册服务配置,如下代码 using Consul; using Microsoft.AspNetCore.Builder; using Microsoft.E 阅读全文
摘要:
一,程序执行慢导致的原因就是查询数据库慢.,导致返回值慢,那这个要怎么解决呢? 1,优化数据库查询如这个文章,导出大量数据到excel,怎么提升性能 2,使用线程并行查询,然后合并成一个集合,代码如下,必须留意备注的核心点 using System; using System.Collections 阅读全文