主要两个步骤: 1.注册服务 builder.Services.AddScoped<ITestServiceA, TestServieceA>(); 2.使用 app.MapGet("TestServiceAShowA",([FromServices] ITestServiceA testServiceA) =>{ return testServiceA.ShowA();}); 案例Demo 1.项目结构 2.MinimalApi.Interfac
专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]
Copyright (C)ICode9.com, All Rights Reserved.
ICode9版权所有