随笔分类 -  .netcore

摘要:一.跨域设置 1.ConfigureServices方法中注入 `services.AddCors(options = { options.AddPolicy("CorsPolicy", builder = builder.AllowAnyOrigin() .AllowAnyMethod() .Al 阅读全文
posted @ 2020-05-18 15:09 纸面具 阅读(766) 评论(0) 推荐(2)
摘要:1.在mysql中创建好数据库 2.项目安装Mysql依赖程序包 3.打开Nuget命令界面 4.输入命令(注意项目中不能有错误) Scaffold DbContext Force "Data Source=127.0.0.1;Port=3306;User Id=root;Password=1234 阅读全文
posted @ 2020-01-16 16:50 纸面具 阅读(221) 评论(0) 推荐(0)
摘要:1.文件中配置 2.单个获取配置文件方法 3.多个获取配置文件方法 添加配置对应的cs文件 public class JWTConfig { public string Issuer { get; set; } public string Audience { get; set; } public 阅读全文
posted @ 2019-12-25 14:03 纸面具 阅读(621) 评论(0) 推荐(0)
摘要:1.swagger的引用 引用Swashbuckle.AspNetCore和Swashbuckle.AspNetCore.Swagger 2.项目属性更改。勾选xml文档文件 3.在ConfigureServices中注册 region swagger //注册Swagger生成器,定义一个和多个S 阅读全文
posted @ 2019-12-24 18:05 纸面具 阅读(352) 评论(0) 推荐(1)