摘要: 一:数据库不存在时重新创建数据库 Database.SetInitializer<testContext>(new CreateDatabaseIfNotExists<testContext>()); 二:每次启动应用程序时创建数据库 Database.SetInitializer<testCont 阅读全文
posted @ 2021-10-22 08:54 tofight 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 在安装MySQL8.0.13的最后一步,配置启动MySQL服务的时候,MySQL启动失败,查看Log日志错误如下: Attempting to start service MySQL80...Failed to start service MySQL80.Waiting until a connec 阅读全文
posted @ 2021-09-24 12:40 tofight 阅读(930) 评论(0) 推荐(0) 编辑
摘要: %AppData%\Roaming\NuGet\NuGet.Config 添加globalPackagesFolder <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.or 阅读全文
posted @ 2021-09-19 18:07 tofight 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 这边要对接一个get请求的api接口,其接口必须传 Content-Type 值 为application/vnd.api+json 否则获取不到数据。 据官方文档介绍。Content-Type 为entity类型只能在request.Content.heads里面设置特么的,真垃圾,用HttpCl 阅读全文
posted @ 2021-08-12 07:05 tofight 阅读(1147) 评论(0) 推荐(0) 编辑
摘要: democontext: public DemoContext(DbContextOptions<DemoContext> options):base(options) { } nuget包: <PackageReference Include="Microsoft.EntityFrameworkC 阅读全文
posted @ 2021-04-11 23:01 tofight 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-04-11 22:59 tofight 阅读(4) 评论(0) 推荐(0) 编辑
摘要: using Demo.Data; using Demo.Domain; using Microsoft.EntityFrameworkCore; using System; using System.Linq; namespace Demo.App { class Program { static 阅读全文
posted @ 2021-04-11 21:53 tofight 阅读(2) 评论(0) 推荐(0) 编辑
摘要: using Demo.Data; using Demo.Domain; using Microsoft.EntityFrameworkCore; using System; using System.Linq; namespace Demo.App { class Program { static 阅读全文
posted @ 2021-04-11 21:36 tofight 阅读(4) 评论(0) 推荐(0) 编辑
摘要: using Demo.Data; using Demo.Domain; using Microsoft.EntityFrameworkCore; using System; using System.Linq; namespace Demo.App { class Program { static 阅读全文
posted @ 2021-04-11 21:29 tofight 阅读(5) 评论(0) 推荐(0) 编辑