执行 fdisk -l 会发现需要的磁盘。 可以看到这是一个空白盘。 开始执行命令将空白磁盘创建分区。 fdisk /dev/sdc 先输入 n。 ommand action <- 选择要创建的分区类型 e extended <- 扩展分区 p primary partition (1-4) <- 主分区 输入 p,再输入 1,剩下选项直接回车。 输入 w ,保存并退出。 格式化并设置磁盘系统: mkfs.ext4 /dev/sdc1 挂载 mount /dev/sdc1 /data/ 查看磁盘挂…

2022年7月28日 2条评论 11838点热度 1人点赞 痴者工良 阅读全文

Directory Structure: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API ### Template Directory 1. Create an empty directory at will, then create one inside it, and create the template directory under templates. The name of th…

2022年7月21日 0条评论 1214点热度 0人点赞 痴者工良 阅读全文

目录结构: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API 模板目录 1,随便创建一个空目录,然后在里面创建一个 ,在 templates 下创建模板目录,这个命令起名要可以随意。S 目录。 2,在 templates 下创建模板目录,这个命令起名要可以随意。这个就是模板存储的目录。 3,模板目录创建两个目录,分别是 content 和 license,license[......] 继续阅读

2022年7月21日 0条评论 12574点热度 0人点赞 痴者工良 阅读全文

When not using ASP.NET Core and without the FluentValidation framework, model validation can be implemented through the native API. public class A { [EmailAddress] public string B { get; set; } } void Main() { var result = new List<ValidationResult>(); v…

2022年7月20日 0条评论 3128点热度 2人点赞 痴者工良 阅读全文

在不使用 ASP.NET Core 时,也不使用 FluentValidation 这里框架,通过原生的 API 实现模型验证。 public class A { [EmailAddress] public string B { get; set; } } void Main() { var result = new List<ValidationResult>(); var a = new A { B = "aa.com" }; var validationContext = new Validati…

2022年7月20日 0条评论 3120点热度 2人点赞 痴者工良 阅读全文

Define the Converter: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return objectType.IsEnum; } public override Enum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions o…

2022年7月18日 0条评论 4697点热度 4人点赞 痴者工良 阅读全文

定义转换器: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return objectType.IsEnum; } public override Enum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var v…

2022年7月18日 0条评论 4675点热度 4人点赞 痴者工良 阅读全文

在 .NET 官方的 Docker 镜像中,添加自定义工具链: FROM mcr.microsoft.com/dotnet/sdk:5.0 RUN apt-get update \ && apt-get install -y --no-install-recommends \ ssh-client \ && rm -rf /var/lib/apt/lists/* 在 Docker 容器中使用 Docker 命令: -u root -v /var/run/docker.sock:/va…

2022年7月12日 0条评论 3550点热度 1人点赞 痴者工良 阅读全文

在 .NET 官方的 Docker 镜像中,添加自定义工具链: FROM mcr.microsoft.com/dotnet/sdk:5.0 RUN apt-get update \ && apt-get install -y --no-install-recommends \ ssh-client \ && rm -rf /var/lib/apt/lists/* 在 Docker 容器中使用 Docker 命令: -u root -v /var/run/docker.sock:/va…

2022年7月12日 0条评论 3532点热度 1人点赞 痴者工良 阅读全文

public async Task ExecuteAsync(HttpContext context) { Context = context; Request = Context.Request; Response = Context.Response; var buffer = new MemoryStream(); Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen:[......]继续阅读

2022年7月5日 0条评论 1494点热度 2人点赞 痴者工良 阅读全文

public async Task ExecuteAsync(HttpContext context) { Context = context; Request = Context.Request; Response = Context.Response; var buffer = new MemoryStream(); Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen:[......]继续阅读

2022年7月5日 0条评论 2285点热度 2人点赞 痴者工良 阅读全文

private static readonly Encoding UTF8NoBOM = new UTF8Encoding( encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); [......] 继续阅读

2022年7月5日 0条评论 1140点热度 0人点赞 痴者工良 阅读全文

private static readonly Encoding UTF8NoBOM = new UTF8Encoding( encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); [......] 继续阅读

2022年7月5日 0条评论 3328点热度 0人点赞 痴者工良 阅读全文

Overall Format General format definition pipeline { // Global environment variables // environment { // IMAGENAME = 'webdemo' // Image name // } // Parameters visible on Jenkins // parameters{ // string(name: 'REPO_NAME' ,defaultValue:'',description:'R[......]…

2022年6月29日 0条评论 3362点热度 2人点赞 痴者工良 阅读全文

整体格式 大体格式定义 pipeline { // 全局环境变量 // environment { // IMAGENAME = 'webdemo' // 镜像名称 // } // Jenkins 上可以看到的参数 // parameters{ // string(name: 'REPO_NAME' ,defaultValue:'',description:'仓库名称',trim:true) // } agent { // 如何启动构建环境,Linux、Window[......]继续阅读

2022年6月29日 0条评论 3360点热度 2人点赞 痴者工良 阅读全文

public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { Console.WriteLine("The program has stopped"); return Task.CompletedTask; } public Task WaitForStartAsync(Cancell[......]继续阅读

2022年6月24日 0条评论 1292点热度 2人点赞 痴者工良 阅读全文

public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { Console.WriteLine("程序停止"); return Task.CompletedTask; } public Task WaitForStartAsync(CancellationToken cancellationToken)[......]继续阅读

2022年6月24日 0条评论 4051点热度 2人点赞 痴者工良 阅读全文

public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilder>>() } { public interface IApplicationBuilder { IFeatureCollection ServerFeatures { get; } IDictionary<string,…

2022年6月24日 0条评论 1242点热度 1人点赞 痴者工良 阅读全文

public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilder>>() } { public interface IApplicationBuilder { IFeatureCollection ServerFeatures { get; } IDictionary<string,…

2022年6月24日 0条评论 3301点热度 1人点赞 痴者工良 阅读全文

Handling some usages of Stream. public static byte[] GetAllBytes(this Stream stream) { using (var memoryStream = new MemoryStream()) { if (stream.CanSeek) { stream.Position = 0; } stream.CopyTo(memoryStream);[......]继续阅读

2022年6月24日 0条评论 3532点热度 0人点赞 痴者工良 阅读全文
1171819202155