1、dotnet ef dbcontext scaffold “Server=127.0.0.1;database=TestDb2;uid=sa;pwd=123456;” “Microsoft.EntityFrameworkCore.SqlServer”-o Core 2、如果是在api控制器里面用public,一定得用【httpget】【httppost】,如果是private的话则不需要。 3、net5.0升级到net6.0,注意要升级swagger的包