Project publish parameters: dotnet publish -c Release -r win-x64 -p:PublishProfile=FolderProfile --no-self-contained dotnet publish -c Release -r wi[......]继续阅读

2022年10月8日 0条评论 128点热度 2人点赞 痴者工良 阅读全文

项目发布参数: dotnet publish -c Release -r win-x64 -p:PublishProfile=FolderProfile --no-self-contained dotnet publish -c Release -r win-x64 -p:PublishProfi[......]继续阅读

2022年10月8日 0条评论 2832点热度 2人点赞 痴者工良 阅读全文

ASP.NET Core Response.Body 默认是 HttpResponseStream,其主要特征是只能追加写,不能读取也不能修改。 所以最根本方法是替换 HttpResponseStream。 随便设置一个中间件,或者将 HttpContext 拿出来,定义变量 context。 替[......] 继续阅读

2022年9月30日 0条评论 3058点热度 0人点赞 痴者工良 阅读全文

ASP.NET Core Response.Body is by default an HttpResponseStream, which is characterized by allowing writes only in append mode, and it cannot be read o[......] 继续阅读

2022年9月30日 0条评论 1690点热度 0人点赞 痴者工良 阅读全文

When performing unit tests, libraries such as Moq are often used to mock the code. However, in some cases, we want to not only mock methods but also d[......] 继续阅读

2022年9月26日 0条评论 130点热度 0人点赞 痴者工良 阅读全文

做单元测试的时候往往会使用 Moq 等库,对代码进行 Mock。 但是有些过程,我们希望除了 Mock 方法之外,能够在 Mock 方法中,判断传递的参数是否正确。 因为常规的 Mock ,是返回一个值。 var mock = new Mock<Test>(); mock.Setup&[......]继续阅读

2022年9月26日 0条评论 3142点热度 0人点赞 痴者工良 阅读全文

Windows.ApplicationModel.Package.Current.InstalledLocation.Path [......] 继续阅读

2022年9月23日 0条评论 88点热度 0人点赞 痴者工良 阅读全文

Windows.ApplicationModel.Package.Current.InstalledLocation.Path [......] 继续阅读

2022年9月23日 0条评论 2248点热度 0人点赞 痴者工良 阅读全文

Razor Page Field Naming Conventions Component Invocation When a component allows external parameters to be passed, properties must be decorated with [[......] 继续阅读

2022年9月15日 0条评论 140点热度 0人点赞 痴者工良 阅读全文

razor 页面字段属性命名规则 组件被调用 一个组件如果允许外部传递参数,需要使用 [Parameter] 修饰属性和大写命名。 <div class="card" style="width:22rem"> <div class="card-body">[......]继续阅读

2022年9月15日 0条评论 1889点热度 0人点赞 痴者工良 阅读全文

原作者:Joydip Kanjilal 原文地址:https://www.codemag.com/Article/2207031/Writing-High-Performance-Code-Using-SpanT-and-MemoryT-in-C 本文采用半译方式。 在本文中,将会介绍 C# 7.2[......] 继续阅读

2022年8月20日 0条评论 2344点热度 3人点赞 痴者工良 阅读全文

原作者:Joydip Kanjilal 原文地址:https://www.codemag.com/Article/2207031/Writing-High-Performance-Code-Using-SpanT-and-MemoryT-in-C 本文采用半译方式。 在本文中,将会介绍 C# 7.[......] 继续阅读

2022年8月20日 0条评论 2342点热度 3人点赞 痴者工良 阅读全文

In MySQL, batch inserting auto-increment columns cannot return the auto-incremented IDs in bulk. To solve the problem of batch insertion, we use atomi[......] 继续阅读

2022年8月19日 0条评论 116点热度 0人点赞 痴者工良 阅读全文

在 Mysql 中,批量插入自增列,是不能批量返回自增后的 Id,为了解决批量插入的问题,利用 Redis 的原子操作,实现无锁原子分配 自增 Id。 核心是在 Redis 中,保存表的最大 Id。 每次插入前,检查缓存 CacheId 跟数据库 MaxId 相比,如果 CacheId > M[......] 继续阅读

2022年8月19日 0条评论 2102点热度 0人点赞 痴者工良 阅读全文

When the collection is null, the code is as follows: List<int>? _a = null; List<int>? _b = null; var[......]继续阅读

2022年8月6日 0条评论 84点热度 1人点赞 痴者工良 阅读全文

当集合为 null 时,代码如下: List<int>? _a = null; List<int>? _b = null; var a = _a?.Any() == false;[......]继续阅读

2022年8月6日 0条评论 2298点热度 1人点赞 痴者工良 阅读全文

[ThreadStatic] private static bool HasCreated = false; [ThreadStatic] private static int Value = 0; void Main() { Console.WriteLine(Thread.Curren[......]继续阅读

2022年8月4日 0条评论 2789点热度 1人点赞 痴者工良 阅读全文

如下面代码: [ThreadStatic] private bool HasCreated = false; [ThreadStatic] private int Value = 0; void Main() { ThreadLocal<string> a = new Thre[......]继续阅读

2022年8月4日 0条评论 2781点热度 1人点赞 痴者工良 阅读全文

目录结构: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API 模板目录 1,随[......] 继续阅读

2022年7月21日 0条评论 2994点热度 0人点赞 痴者工良 阅读全文

Directory Structure: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API ### Template Directory 1. Create an empty[......]继续阅读

2022年7月21日 0条评论 116点热度 0人点赞 痴者工良 阅读全文
1789101118