1 2 3 4 5 ··· 100 下一页
摘要: private readonly ITestOutputHelper _testOutputHelper; ctor 构造函数 pulic Xx(ITestOutputHelper testOutputHelper) { _testOutputHelper = testOutputHelper; } 阅读全文
posted @ 2026-12-04 09:00 市丸银 阅读(3) 评论(0) 推荐(0)
摘要: 一、工具类 using ServiceContract.DTO; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using 阅读全文
posted @ 2026-12-03 16:40 市丸银 阅读(1) 评论(0) 推荐(0)
摘要: 一、项目布局 1、项目 2、xUnit 3、ServicesContract DTO(数据传输对象 Request和Response)、Enums 4、Services 5、Entities(实体类) 注意: 1、Controllers层和测试层,不接触实体层(Entities),只有Service 阅读全文
posted @ 2026-12-03 16:38 市丸银 阅读(2) 评论(0) 推荐(0)
摘要: 一、基础 IConfiguration 注入 private readonly IConfiguration _configuration; public HomeController(IConfiguration configuration) { _configuration = configur 阅读全文
posted @ 2026-11-28 19:30 市丸银 阅读(9) 评论(0) 推荐(0)
摘要: 一、种类 1、Development 2、Staging 3、Production 二、使用 1、配置(program.cs) if (app.Environment.IsProduction()) { app.UseDeveloperExceptionPage(); } 2、控制器(IWebHos 阅读全文
posted @ 2026-11-28 14:33 市丸银 阅读(5) 评论(0) 推荐(0)
摘要: 一、概念 /** *依赖反转:Controllers 依赖 Services Controllers 依赖 ServiceContracts Service 依赖 ServiceContracts *控制反转:Controllers 创建 对象 IOC容器创建对象,并且给Controllers *依 阅读全文
posted @ 2026-11-28 10:42 市丸银 阅读(6) 评论(0) 推荐(0)
摘要: 一、创建 1、视图组件类 a、新建文件夹 ViewComponents b、新建类 xxViewComponent.cs 注意:继承 ViewComponent c、创建方法 using Microsoft.AspNetCore.Mvc; namespace PartialViewDemon.Vie 阅读全文
posted @ 2026-11-25 17:40 市丸银 阅读(5) 评论(0) 推荐(0)
摘要: 一、创建 1、位置:Shared 文件夹 2、视图名:_xxxxPartialView.cshtml 二、使用 1、引用 <partial name = ""/> 需要引用 addTageHelper 内容 @await Html.PartialAsync("") 内容 @await Html.Re 阅读全文
posted @ 2026-11-25 15:02 市丸银 阅读(5) 评论(0) 推荐(0)
摘要: 一、布局视图 1、创建 Shared => 创建 布局视图 2、使用 普通视图 @{ Layout="_Layout"; } 二、数据传输 外层_ViewImports.cshtml => 外层_ViewStart.cshtml => 控制器视图层_ViewImports.cshtml => _Vi 阅读全文
posted @ 2026-11-24 14:17 市丸银 阅读(6) 评论(0) 推荐(0)
摘要: Views/Shared 1、控制器 先找, Views/控制器名称/action名称.cshtml 再找 , Views/Sahred/action名称.cshtml 阅读全文
posted @ 2026-11-23 11:47 市丸银 阅读(5) 评论(0) 推荐(0)
1 2 3 4 5 ··· 100 下一页