04 2019 档案
摘要:正常是可以获取数据的,不过这次抛了异常,异常信息如下 The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set 解决办法: 代码
阅读全文
摘要:https://stackoverflow.com/questions/49588205/should-restclient-be-singleton-or-new-for-every-request Q1: should I use singleton pattern for RestClient
阅读全文
摘要:一、Nginx官网 http://nginx.org/ 二、下载并安装Nginx 下载地址:http://nginx.org/en/download.html 启动Nginx,启动成功的话可以在任务管理器里看到,如图所示: 三、新建asp.net MVC项目 源码地址:https://github.
阅读全文
摘要:一、新建.net core控制台程序 二、通过Nuget引入 Microsoft.Extensions.Configuration和microsoft.extensions.configuration.json 三、引入配置文件appsettings.Debug.json 四、新建类JsonConf
阅读全文
摘要:一、官方文档 https://autofaccn.readthedocs.io/zh/latest/index.html 二、新建.net core 控制台程序 三、注册类型,示例一 1、新建接口 IPerson 2、实现接口,新建类Worker 3、新建类RegisterConsoles并注册组件
阅读全文
摘要:在EF core里,可以通过实现IEntityTypeConfiguration来进行映射。 一、官网文档 https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-2.0 二、示例(.net core控制台程序) 示例使用的数据库是m
阅读全文
摘要:原回答:https://stackoverflow.com/questions/26957519/ef-core-mapping-entitytypeconfiguration 反射 protected override void OnModelCreating(ModelBuilder build
阅读全文
摘要:net start mysql 启动mysql服务,启动失败: 手动启动服务,又失败 命令查看日志:mysqld --console 在网上找了解决办法如下: 找到mysql目录,进去bin目录,找到并删除两个文件:删除以下2个文件:ib_logfile0和ib_logfile1 重启mysql,成
阅读全文
摘要:官方文档:https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/middleware/?view=aspnetcore-2.1 中间件的定义:中间件是组装到应用程序管道中以处理请求和响应的软件 ASP.NET Core请求流程由一系列请求
阅读全文
摘要:测试本地的WebApi接口时,接口是https,自己写的用httpclient测试是可以的, 用postman一直连接不了。原因正是由于https,不过postman在界面上已经给出了可能的原因和解决方法: Self-signed SSL certificates are being blocked
阅读全文
摘要:客户端 HttpClient 服务端.net core Web Api
阅读全文
摘要:for (int i = imgList.Count - 1; i >= 0; i--) { var l = imgList[i].Trim(); if (!l.ToLower().Contains(".jpg") && !l.ToLower().Contains(".png")) ...
阅读全文