EFcore迁移报错:“Unable to create an object of type ‘MyDbContext‘. For the different patterns supported ”
我们在输入迁移命令Add-Migrationinit后发生错误!错误的原因我就不说了,直接上解决方法!第一步:先创建一个DbContextDesignTimeFactory类第二步:继承IDesignTimeDbContextFactory在///1.写一个类///2.实现IDesignTimeContextFactory接口///3.返回Dbcontext类就行了///publicclassDb