在 .NET 官方的 Docker 镜像中,添加自定义工具链: FROM mcr.microsoft.com/dotnet/sdk:5.0 RUN apt-get update \ && apt-get install -y --no-install-recommends \[......]继续阅读
在 .NET 官方的 Docker 镜像中,添加自定义工具链: FROM mcr.microsoft.com/dotnet/sdk:5.0 RUN apt-get update \ && apt-get install -y --no-install-recommends \[......]继续阅读
在 .NET 官方的 Docker 镜像中,添加自定义工具链: FROM mcr.microsoft.com/dotnet/sdk:5.0 RUN apt-get update \ && apt-get install -y --no-install-recommends \[......]继续阅读
public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { C[......]继续阅读
public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { C[......]继续阅读
public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilde[......]继续阅读
public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilder[......]继续阅读
Packages: Microsoft.AspNetCore.Mvc.Testing Microsoft.AspNetCore.TestHost Moq Integration testing can ensure that application components are functioni[......] 继续阅读
包: Microsoft.AspNetCore.Mvc.Testing Microsoft.AspNetCore.TestHost Moq 集成测试可在包含应用支持基础结构(如数据库、文件系统和网络)的级别上确保应用组件功能正常。 ASP.NET Core 通过将单元测试框架与测试 Web 主机和内[......] 继续阅读
继承 IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// 状态码 /// </summ[......]继续阅读
Inheriting from IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// Status code[......]继续阅读
有读者回复推荐全局异常拦截使用 app.UseExceptionHandler();。 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-9.0 跟本身的主要区别是请求到[......] 继续阅读
There are readers suggesting to use app.UseExceptionHandler(); for global exception interception. https://learn.microsoft.com/en-us/aspnet/core/fundam[......] 继续阅读
直接使用 .NET 的 CLR 库生成,不依赖第三方框架。 已将代码修正为最新实现,去掉过时接口。 基于密码的密钥导出函数2(PBKDF2)让别人更难通过穷举法猜到你的帐户密码。 pbkdf2 加密是不可逆的,因此可以用来处理密码等,只能对比,不能还原。 比如说,每个用户设置一个加密密钥,每个用户使[......] 继续阅读
Directly use the .NET CLR library for generation without relying on third-party frameworks. The code has been updated to the latest implementation, re[......] 继续阅读
当直接使用 API 获取 Claim 时,是不会检查 Token 的密钥是否正确的。 var jwt = jwtSecurityTokenHandler.ReadJwtToken(token); 如果要同时检查 Token,则可以这样使用: [......]继续阅读
When directly using the API to get a Claim, the correctness of the Token's key is not checked. var jwt = jwtSecurityTokenHandler.ReadJ[......]继续阅读
中间件示例: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Text; using Syst[......]继续阅读
Middleware example: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Tex[......]继续阅读
导读 CZGL.ProcessMetrics 是一个 Metrics 库,能够将程序的 GC、CPU、内存、机器网络、磁盘空间等信息记录下来,使用 Prometheus 采集信息,然后使用 Grafana 显示。 周日花了时间把这个库更新,修复了一些 Bug,增加了一些有趣的功能,支持多服务器多应用[......] 继续阅读
Introduction CZGL.ProcessMetrics is a metrics library that records information such as GC, CPU, memory, machine network, and disk space of application[......] 继续阅读