Inheriting from IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// Status code[......]继续阅读
Inheriting from IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// Status code[......]继续阅读
继承 IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// 状态码 /// </summ[......]继续阅读
There are readers suggesting to use app.UseExceptionHandler(); for global exception interception. https://learn.microsoft.com/en-us/aspnet/core/fundam[......] 继续阅读
有读者回复推荐全局异常拦截使用 app.UseExceptionHandler();。 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-9.0 跟本身的主要区别是请求到[......] 继续阅读
Middleware example: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Tex[......]继续阅读
中间件示例: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Text; using Syst[......]继续阅读
In ControllerBase, its HttpContext is null by default. These properties depend on ControllerContext. Of course, we can also inject IHttpContextAcces[......] 继续阅读
在 ControllerBase 中,其 HttpContext 的默认为空。 这些属性依赖于 ControllerContext。 当然我们也可以注入 IHttpContextAccessor,在每个控制器的构造函数中写进去,比较麻烦。我可以统一通过 控制器激活器进行统一注入。 ///[......]继续阅读
In the backend, when there are distributed demands, we often use 64-bit numeric types to represent field types. However, the frontend does not support[......] 继续阅读
在后端中,当有分布式需求时,我们常常使用 64位 的数字类型表示字段类型,但是前端并不支持超过 16 位长度的数值类型,所以后端长度较大的 long、ulong 数值传到后端,其准确度就已经丢失。 解决方法就是将 ulong、long 转为字符串,传递给后端。 public class Te[......]继续阅读
.NET Core Logging and Distributed Tracing .NET Core Logging Console Output Non-intrusive Logging Microsoft.Extensions.Logging ILoggerFactory ILogg[......] 继续阅读
.NET Core 中的日志与分布式链路追踪 .NET Core 中的日志 控制台输出 非侵入式日志 Microsoft.Extensions.Logging ILoggerFactory ILoggerProvider ILogger Logging Providers 怎么使用 日志等级[......] 继续阅读
ASP.NET Core 中的策略授权 策略 定义一个 Controller 设定权限 定义策略 存储用户信息 标记访问权限 认证:Token 凭据 颁发登录凭据 自定义授权 IAuthorizationService ABP 授权 创建 ABP 应用 定义权限 Github 仓库源码[......] 继续阅读
Policy-Based Authorization in ASP.NET Core Policy Defining a Controller Setting Permissions Defining Policies Storing User Information Marking Acces[......] 继续阅读
首先要了解 ASP.NET Core 中的配置,请点击这里了解:https://www.cnblogs.com/whuanle/p/13061059.html 1,选项接口 ASP.NET Core 中的选项接口,一共有三个,分别是: IOptions<TOptions> IOptio[......] 继续阅读
First, to understand the configuration in ASP.NET Core, please click here: https://www.cnblogs.com/whuanle/p/13061059.html 1. Options Interfaces In AS[......] 继续阅读
ASP.NET Core 中,可以使用 ConfigurationBuilder 对象来构建。 主要分为三部:配置数据源 -> ConfigurationBuilder -> 使用。 数据源可来自字典或配置文件。 数据源要么继承 IConfigurationSource ,要么从配置文件[......] 继续阅读
ASP.NET Core provides the ConfigurationBuilder object for building configurations. It mainly consists of three steps: configuring the data source ->[......] 继续阅读
Blazor事件分类 Blazor 触发方式 HTML标准事件分类 1)Window 事件属性 2)表单事件 3)键盘事件 4)鼠标事件 5)媒介事件 Blazor 事件分类 Blazor 组件中, HTML 元素可以触发事件,使用 @on{事件名} 格式绑定触发的事件。 @on{}是触发[......] 继续阅读
Blazor Event Classification Blazor Triggering Methods HTML Standard Event Classification 1) Window Event Properties 2) Form Events 3) Keyboard Event[......] 继续阅读