会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
市丸银
知行合一
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
5
···
100
下一页
2026年12月4日
asp .net core xUnit TestOutputHelper
摘要: private readonly ITestOutputHelper _testOutputHelper; ctor 构造函数 pulic Xx(ITestOutputHelper testOutputHelper) { _testOutputHelper = testOutputHelper; }
阅读全文
posted @ 2026-12-04 09:00 市丸银
阅读(3)
评论(0)
推荐(0)
2026年12月3日
asp .net core 对象特性验证 模型绑定
摘要: 一、工具类 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)
xunit 使用技巧 TDD 测试驱动开发
摘要: 一、项目布局 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)
2026年11月28日
asp .net core 配置 (应用设置)
摘要: 一、基础 IConfiguration 注入 private readonly IConfiguration _configuration; public HomeController(IConfiguration configuration) { _configuration = configur
阅读全文
posted @ 2026-11-28 19:30 市丸银
阅读(9)
评论(0)
推荐(0)
asp .net core 环境
摘要: 一、种类 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)
asp .net core IoC DI
摘要: 一、概念 /** *依赖反转:Controllers 依赖 Services Controllers 依赖 ServiceContracts Service 依赖 ServiceContracts *控制反转:Controllers 创建 对象 IOC容器创建对象,并且给Controllers *依
阅读全文
posted @ 2026-11-28 10:42 市丸银
阅读(6)
评论(0)
推荐(0)
2026年11月25日
asp .net core 视图组件
摘要: 一、创建 1、视图组件类 a、新建文件夹 ViewComponents b、新建类 xxViewComponent.cs 注意:继承 ViewComponent c、创建方法 using Microsoft.AspNetCore.Mvc; namespace PartialViewDemon.Vie
阅读全文
posted @ 2026-11-25 17:40 市丸银
阅读(5)
评论(0)
推荐(0)
asp .net core 部分视图
摘要: 一、创建 1、位置:Shared 文件夹 2、视图名:_xxxxPartialView.cshtml 二、使用 1、引用 <partial name = ""/> 需要引用 addTageHelper 内容 @await Html.PartialAsync("") 内容 @await Html.Re
阅读全文
posted @ 2026-11-25 15:02 市丸银
阅读(5)
评论(0)
推荐(0)
2026年11月24日
asp .net core 布局视图
摘要: 一、布局视图 1、创建 Shared => 创建 布局视图 2、使用 普通视图 @{ Layout="_Layout"; } 二、数据传输 外层_ViewImports.cshtml => 外层_ViewStart.cshtml => 控制器视图层_ViewImports.cshtml => _Vi
阅读全文
posted @ 2026-11-24 14:17 市丸银
阅读(6)
评论(0)
推荐(0)
2026年11月23日
asp .net core MVC 共享视图
摘要: 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
下一页
公告