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[......] 继续阅读
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[......] 继续阅读
做单元测试的时候往往会使用 Moq 等库,对代码进行 Mock。 但是有些过程,我们希望除了 Mock 方法之外,能够在 Mock 方法中,判断传递的参数是否正确。 因为常规的 Mock ,是返回一个值。 var mock = new Mock<Test>(); mock.Setup&[......]继续阅读
Windows.ApplicationModel.Package.Current.InstalledLocation.Path [......] 继续阅读
首先映射是按照块来映射的,每个块内都有一个块内地址,记录每个字长的位置。 本文部分图片来源参考:https://blog.csdn.net/weixin_42649617/article/details/105092395 直接映射 特点是内存与 Cache 之间的映射位置是固定的,其中内存到[......] 继续阅读
首先映射是按照块来映射的,每个块内都有一个块内地址,记录每个字长的位置。 本文部分图片来源参考:https://blog.csdn.net/weixin_42649617/article/details/105092395 直接映射 特点是内存与 Cache 之间的映射位置是固定的,其中内存到[......] 继续阅读
Razor Page Field Naming Conventions Component Invocation When a component allows external parameters to be passed, properties must be decorated with [[......] 继续阅读
razor 页面字段属性命名规则 组件被调用 一个组件如果允许外部传递参数,需要使用 [Parameter] 修饰属性和大写命名。 <div class="card" style="width:22rem"> <div class="card-body">[......]继续阅读
MAUI Blazor uses WebView2 on Windows, and the MAUI Blazor runtime environment is independent of the application. Even if the system language is set to[......] 继续阅读
MAUI Blazor 在 Windows 上使用的是 WebView2,MAUI Blazor 运行环境是跟程序没关系的,即使是系统设置了中文语言,程序集设置了中文,本地文化设置了中文,CultureInfo 设置了中文,统统都没有用。 你可以在程序启动后,按下 F12,然后执行 JavaScri[......] 继续阅读
Fixing issues related to missing components in the system: DISM.exe /Online /Cleanup-image /Scanhealth DISM.exe /Online /Cleanup-image /Checkhealth[......]继续阅读
修复系统缺少组件等问题: DISM.exe /Online /Cleanup-image /Scanhealth DISM.exe /Online /Cleanup-image /Checkhealth DISM.exe /Online /Cleanup-image /Restorehealth[......]继续阅读
原作者:Joydip Kanjilal 原文地址:https://www.codemag.com/Article/2207031/Writing-High-Performance-Code-Using-SpanT-and-MemoryT-in-C 本文采用半译方式。 在本文中,将会介绍 C# 7.2[......] 继续阅读
原作者:Joydip Kanjilal 原文地址:https://www.codemag.com/Article/2207031/Writing-High-Performance-Code-Using-SpanT-and-MemoryT-in-C 本文采用半译方式。 在本文中,将会介绍 C# 7.[......] 继续阅读
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[......] 继续阅读
在 Mysql 中,批量插入自增列,是不能批量返回自增后的 Id,为了解决批量插入的问题,利用 Redis 的原子操作,实现无锁原子分配 自增 Id。 核心是在 Redis 中,保存表的最大 Id。 每次插入前,检查缓存 CacheId 跟数据库 MaxId 相比,如果 CacheId > M[......] 继续阅读
When the collection is null, the code is as follows: List<int>? _a = null; List<int>? _b = null; var[......]继续阅读
[ThreadStatic] private static bool HasCreated = false; [ThreadStatic] private static int Value = 0; void Main() { Console.WriteLine(Thread.Curren[......]继续阅读
如下面代码: [ThreadStatic] private bool HasCreated = false; [ThreadStatic] private int Value = 0; void Main() { ThreadLocal<string> a = new Thre[......]继续阅读