[ThreadStatic] private static bool HasCreated = false; [ThreadStatic] private static int Value = 0; void Main() { Console.WriteLine(Thread.CurrentThread.ManagedThreadId); ThreadLocal<string> a = new ThreadLocal<string>(() => { if (HasCreated) re…

2022年8月4日 0条评论 3259点热度 1人点赞 痴者工良 阅读全文

如下面代码: [ThreadStatic] private bool HasCreated = false; [ThreadStatic] private int Value = 0; void Main() { ThreadLocal<string> a = new ThreadLocal<string>(() => { if (HasCreated) return Value.ToString(); else { Value = Thread.CurrentThread.[....…

2022年8月4日 0条评论 3281点热度 1人点赞 痴者工良 阅读全文

Docker Deployment: docker run -d \ --name=calibre-web \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -e DOCKER_MODS=linuxserver/mods:universal-calibre `#optional` \ -e OAUTHLIB_RELAX_TOKEN_SCOPE=1 `#optional` \ -p 8083:8083 \ -v /data/book/config:/confi…

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

Docker 部署: docker run -d \ --name=calibre-web \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -e DOCKER_MODS=linuxserver/mods:universal-calibre <code>#optional</code> \ -e OAUTHLIB_RELAX_TOKEN_SCOPE=1 <code>#optional</code> \ -p 8…

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

Execute fdisk -l to find the required disk. As you can see, this is a blank disk. Start executing commands to create a partition on the blank disk. fdisk /dev/sdc First, enter n. Command action <- Select the type of partition to create e extended <- Exte…

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

执行 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条评论 4014点热度 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条评论 600点热度 0人点赞 痴者工良 阅读全文

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

2022年7月21日 0条评论 3514点热度 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条评论 2642点热度 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条评论 2580点热度 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条评论 4033点热度 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条评论 3909点热度 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条评论 2986点热度 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条评论 2992点热度 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条评论 628点热度 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条评论 1677点热度 2人点赞 痴者工良 阅读全文

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

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

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

2022年7月5日 0条评论 2682点热度 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条评论 2718点热度 2人点赞 痴者工良 阅读全文

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

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