事由: 这两天mentor给我布置了个任务让我用BenchmarkDotNet工具去测试一下同一个API 用同步和异步方法写性能上有什么差别. 顺带提一下: 啊啊啊啊 等我仔细看文档的时候文档 发现它让我用Release的模式去运行benchmark. emmm...其实我之前一直在用Debug模式调试.. 所以各位在运行的时候,The best way is build our benchmark in the Release mode and run it from the command
1.使用VS 2015 新建了一个Core API项目,然后把他的依赖升级到最新(我机器VS 2015默认的包都是rc版本),然后publish. 2.在publish目录的同级目录下,新建Dockerfile,没有后缀,里面内容如下: FROM microsoft/dotnet:latest WORKDIR /root # Copy the app COPY PublishOutput /root/ # Configure the listening port to #ENV ASPNETCO
我们在使用EF Core的时候,很多时候需要在Visual Studio的输出窗口中知道EF Core在后台生成的SQL语句是什么,这个需求可以通过自定义EF Core的ILoggerFactory和ILogger类来实现: 首先定义一个实现了ILogger接口的类EFLogger,主要目的是将EF Core生成的Log信息输出到Visual Studio的输出窗口: using Microsoft.Extensions.Logging; using System; using System.D