背景 最先采用的是 Maui + Blazor 开发,使用社区热度比较高的 Blazor UI 框架。 可是开发进行过程中, Maui 巨多坑,Blazor UI 框架也是巨多坑,使用 Blazor UI 写的页面和样式,过不了设计师和产品经理的是法眼。 最终决定使用原生前端结合,生成静态内容放到[......] 继续阅读
背景 最先采用的是 Maui + Blazor 开发,使用社区热度比较高的 Blazor UI 框架。 可是开发进行过程中, Maui 巨多坑,Blazor UI 框架也是巨多坑,使用 Blazor UI 写的页面和样式,过不了设计师和产品经理的是法眼。 最终决定使用原生前端结合,生成静态内容放到[......] 继续阅读
Background The initial approach adopted was to develop using Maui + Blazor, utilizing the Blazor UI framework, which has high community popularity. Ho[......] 继续阅读
bool IsDefine<T1, T2>(T2 t) where T1 : Enum where T2 : Enum { var value = Unsafe.As<T2, T1>(ref t); var array = Enum.GetValue[......]继续阅读
bool IsDefine<T1, T2>(T2 t) where T1 : Enum where T2 : Enum { var value = Unsafe.As<T2, T1>(ref t); var array = Enum.GetValues(type[......]继续阅读
在项目使用分部类,如 Razor、Blazor、Wpf 等项目中,编译会生成 .g.cs 文件,但是因为出现了问题,不能编译成功,查看源代码,找不出错误,只能开始输出 .g.cs ,查看文件进行检查。 <PropertyGroup> <EmitCompilerGenerat[......]继续阅读
In projects using partial classes, such as Razor, Blazor, WPF, etc., the compilation will generate .g.cs files. However, if there are issues that prev[......] 继续阅读
// json => Dictionary static Dictionary<string, string> Read(string jsonData) { var reader = new Utf8Jso[......]继续阅读
// json => Dictionary static Dictionary<string, string> Read(string jsonData) { var reader = new Utf8Jso[......]继续阅读
private static void RunPowershellScript(string scriptFile) { ProcessStartInfo ps = new ProcessStartInfo(@"powershell.exe",scriptFile) { RedirectSt[......]继续阅读
private static void RunPowershellScript(string scriptFile) { ProcessStartInfo ps = new ProcessStartInfo(@"powershell.exe", scriptFile) { Re[......]继续阅读
using System.Resources; var assembly = typeof(Program).Assembly; ResourceManager resourceManager = new ResourceManager("update.Prope[......]继续阅读
using System.Resources; var assembly = typeof(Program).Assembly; ResourceManager resourceManager = new ResourceManager("update[......]继续阅读
Project publish parameters: dotnet publish -c Release -r win-x64 -p:PublishProfile=FolderProfile --no-self-contained dotnet publish -c Release -r wi[......]继续阅读
项目发布参数: dotnet publish -c Release -r win-x64 -p:PublishProfile=FolderProfile --no-self-contained dotnet publish -c Release -r win-x64 -p:PublishProfi[......]继续阅读
ASP.NET Core Response.Body 默认是 HttpResponseStream,其主要特征是只能追加写,不能读取也不能修改。 所以最根本方法是替换 HttpResponseStream。 随便设置一个中间件,或者将 HttpContext 拿出来,定义变量 context。 替[......] 继续阅读
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[......] 继续阅读
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 [......] 继续阅读