1.项目结构 数据库:SQL Server 项目类型:MinimalAPI 2.MinimalApi.Db类库 (1)引入相关的NuGet包 Microsoft.EntityFrameworkCore Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools Microsoft.Extensions.Logging.Console System.Data.SqlClie
主要两个步骤: 1.注册服务 builder.Services.AddScoped<ITestServiceA, TestServieceA>(); 2.使用 app.MapGet("TestServiceAShowA",([FromServices] ITestServiceA testServiceA) =>{ return testServiceA.ShowA();}); 案例Demo 1.项目结构 2.MinimalApi.Interfac