docs: 更新多篇技术文档的元数据和格式
- 添加Entity Framework Core文档 - 更新大数据文档的标签和格式 - 完善Claude Code文档的元数据和表格格式 - 为C#和ASP.NET Core文档添加.NET标签 - 修正大模型文档的标签和表格格式
This commit is contained in:
@@ -4,6 +4,7 @@ date: 2021-03-23 10:30:31
|
||||
author: 文永达
|
||||
permalink: asp-net-core/
|
||||
top_img: https://gcore.jsdelivr.net/gh/volantis-x/cdn-wallpaper/abstract/67239FBB-E15D-4F4F-8EE8-0F1C9F3C4E7C.jpeg
|
||||
tags: .NET
|
||||
---
|
||||
# IDE智能提示优化
|
||||
|
||||
@@ -20,7 +21,7 @@ dotnet tool install -g islocalizer
|
||||
`.net6`的汉化包已经有现成的了,可以直接进行安装
|
||||
|
||||
```shell
|
||||
islocalizer install auto -m net6.0 -l zh-cn
|
||||
islocalizer install auto -m net6.0 -l zh-cn
|
||||
```
|
||||
|
||||
工具会自动从`github`下载对应的包进行安装(可能需要访问加速)。
|
||||
@@ -134,7 +135,7 @@ docker ps
|
||||
cd /usr/local/jenkins_home/workspace/XiaodaERP_NetCore
|
||||
echo $PWD
|
||||
docker image build -f ./XiaodaERP/Dockerfile -t xiaodaerp/netcore .
|
||||
docker images
|
||||
docker images
|
||||
docker run --name xiaodaerp/netcore -p 7274:80 -d xiaodaerp/netcore
|
||||
```
|
||||
|
||||
@@ -475,7 +476,7 @@ http {
|
||||
```
|
||||
- 如果`$http_upgrade`的值与`default`不匹配(通常是指`$http_upgrade`未设置或未匹配任何其他条件),则将`$connection_upgrade`设置为`upgrade`。
|
||||
- 如果`$http_upgrade`的值为空字符串(''),则将`$connection_upgrade`设置为`close`。这意味着Nginx将关闭连接而不是升级。
|
||||
|
||||
|
||||
2. 第二个`map`块(微软官方用法):
|
||||
```conf
|
||||
map $http_connection $connection_upgrade {
|
||||
@@ -483,7 +484,7 @@ http {
|
||||
default keep-alive;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
- 如果`$http_connection`的值匹配正则表达式`~*Upgrade`(不区分大小写地匹配包含"Upgrade"的值),则将`$connection_upgrade`设置为`$http_connection`的值,通常是`upgrade`。
|
||||
- 如果没有匹配的值,将`$connection_upgrade`设置为`keep-alive`。这意味着Nginx将保持HTTP连接保持活动状态以进行进一步的请求和响应。
|
||||
|
||||
@@ -653,7 +654,7 @@ namespace XiaodaERP.Utils
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly JwtSecurityTokenHandler _jwtSecurityTokenHandler;
|
||||
public TokenHelper(IConfiguration configuration, JwtSecurityTokenHandler jwtSecurityTokenHandler)
|
||||
{
|
||||
{
|
||||
this._configuration = configuration;
|
||||
this._jwtSecurityTokenHandler = jwtSecurityTokenHandler;
|
||||
}
|
||||
@@ -735,7 +736,7 @@ namespace XiaodaERP.Utils
|
||||
public ViewUser Login(string UserName, string PassWord)
|
||||
{
|
||||
var res = _sqlServerDbContext.Users.Include(user => user.Role).FirstOrDefault(x => x.UserName == UserName);
|
||||
if (res != null)
|
||||
if (res != null)
|
||||
{
|
||||
if (res.PassWord == Md5Encoding(PassWord))
|
||||
{
|
||||
@@ -884,7 +885,7 @@ namespace XiaodaERP.Attributes
|
||||
sysActionLog.ActionUserId = us.UserId;
|
||||
Console.WriteLine(us.username);
|
||||
sysActionLog.ActionUserName = us.username;
|
||||
}
|
||||
}
|
||||
sysActionLog.ActionTime = DateTime.Now;
|
||||
}
|
||||
_sqlServerDbContext.SysActionLogs.Add(sysActionLog);
|
||||
@@ -997,7 +998,7 @@ app.UseIpRateLimiting();
|
||||
"ClientIdHeader": "X-ClientId",
|
||||
//限制状态码
|
||||
"HttpStatusCode": 429,
|
||||
////IP白名单:支持Ip v4和v6
|
||||
////IP白名单:支持Ip v4和v6
|
||||
//"IpWhitelist": [ "127.0.0.1", "::1/10", "192.168.0.0/24" ],
|
||||
////端点白名单
|
||||
//"EndpointWhitelist": [ "get:/api/license", "*:/api/status" ],
|
||||
@@ -1071,13 +1072,13 @@ app.UseIpRateLimiting();
|
||||
using (var serviceScope = app.Services.CreateScope())
|
||||
{
|
||||
var services = serviceScope.ServiceProvider;
|
||||
|
||||
|
||||
// get the IpPolicyStore instance
|
||||
var ipPolicyStore = services.GetRequiredService<IIpPolicyStore>();
|
||||
|
||||
// seed IP data from appsettings
|
||||
ipPolicyStore.SeedAsync().GetAwaiter().GetResult();
|
||||
|
||||
|
||||
var clientPolicyStore = services.GetRequiredService<IClientPolicyStore>();
|
||||
clientPolicyStore.SeedAsync().GetAwaiter().GetResult();
|
||||
}
|
||||
@@ -1141,16 +1142,16 @@ public class CustomIpRateLimitMiddleware : IpRateLimitMiddleware
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private readonly IIpRateLimitLogService _ipRateLimitLogService;
|
||||
|
||||
public CustomIpRateLimitMiddleware(RequestDelegate next, IProcessingStrategy processingStrategy,
|
||||
IOptions<IpRateLimitOptions> options, IIpPolicyStore policyStore, IRateLimitConfiguration config,
|
||||
|
||||
public CustomIpRateLimitMiddleware(RequestDelegate next, IProcessingStrategy processingStrategy,
|
||||
IOptions<IpRateLimitOptions> options, IIpPolicyStore policyStore, IRateLimitConfiguration config,
|
||||
ILogger<IpRateLimitMiddleware> logger, IIpRateLimitLogService ipRateLimitLogService) : base(next, processingStrategy, options, policyStore, config, logger)
|
||||
{
|
||||
_ipRateLimitLogService = ipRateLimitLogService;
|
||||
}
|
||||
|
||||
|
||||
// 重写 用于记录被阻止的请求的日志
|
||||
protected override void LogBlockedRequest(HttpContext httpContext, ClientRequestIdentity identity,
|
||||
protected override void LogBlockedRequest(HttpContext httpContext, ClientRequestIdentity identity,
|
||||
RateLimitCounter counter, RateLimitRule rule)
|
||||
{
|
||||
// base.LogBlockedRequest(httpContext, identity, counter, rule);
|
||||
@@ -1260,9 +1261,9 @@ public class HelloQuartzJob : IJob
|
||||
{
|
||||
public Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
return Task.Factory.StartNew(() =>
|
||||
return Task.Factory.StartNew(() =>
|
||||
{
|
||||
Console.WriteLine("Hello Quartz.Net");
|
||||
Console.WriteLine("Hello Quartz.Net");
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1276,12 +1277,12 @@ Job不是孤立存在的,它需要执行的参数,这些参数如何传递
|
||||
public class SayHelloJob : IJob
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
|
||||
|
||||
public Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
return Task.Factory.StartNew(() =>
|
||||
return Task.Factory.StartNew(() =>
|
||||
{
|
||||
Console.WriteLine($"Hello {UserName}!");
|
||||
Console.WriteLine($"Hello {UserName}!");
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1516,7 +1517,7 @@ NLog 配置文件是一个以`nlog`为根节点的 XML 文件。`nlog`节点可
|
||||
|
||||
```xml
|
||||
<nlog>
|
||||
<extensions>
|
||||
<extensions>
|
||||
<add assembly="MyAssembly" />
|
||||
</extensions>
|
||||
<targets>
|
||||
@@ -1577,7 +1578,7 @@ NLog 4.4.2 之后可以使用通配符`*`指定多个文件。例如,`<include
|
||||
var logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
2. `NLog.LogManager.GetLogger`方法
|
||||
通过`NLog.LogManager.GetLogger("MyLogger")`方法可以显示地指定`NLog.Logger`的名称为MyLogger。
|
||||
@@ -1917,12 +1918,12 @@ gRPC 客户端类型通过依赖性注入(DI)注册为暂时性。现在可以
|
||||
public class AggregatorService : Aggregator.AggregatorBase
|
||||
{
|
||||
private readonly Greeter.GreeterClient _client;
|
||||
|
||||
|
||||
public AggregatorService(Greeter.GreeterClient client)
|
||||
{
|
||||
_client = client;
|
||||
}
|
||||
|
||||
|
||||
public override async Task SayHellos(HelloRequest request,
|
||||
IServerStreamWriter<HelloReply> responseStream, ServerCallContext context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user