原作者:Joydip Kanjilal 原文地址:https://www.codemag.com/Article/2207031/Writing-High-Performance-Code-Using-SpanT-and-MemoryT-in-C 本文采用半译方式。 在本文中,将会介绍 C# 7.[......] 继续阅读

2022年8月20日 0条评论 4062点热度 3人点赞 痴者工良 阅读全文

当集合为 null 时,代码如下: List<int>? _a = null; List<int>? _b = null; var a = _a?.Any() == false;[......]继续阅读

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

When the collection is null, the code is as follows: List<int>? _a = null; List<int>? _b = null; var[......]继续阅读

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

如下面代码: [ThreadStatic] private bool HasCreated = false; [ThreadStatic] private int Value = 0; void Main() { ThreadLocal<string> a = new Thre[......]继续阅读

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

[ThreadStatic] private static bool HasCreated = false; [ThreadStatic] private static int Value = 0; void Main() { Console.WriteLine(Thread.Curren[......]继续阅读

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

目录结构: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API 模板目录 1,随[......] 继续阅读

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

Directory Structure: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API ### Template Directory 1. Create an empty[......]继续阅读

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

定义转换器: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return object[......]继续阅读

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

Define the Converter: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return obj[......]继续阅读

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

public async Task ExecuteAsync(HttpContext context) { Context = context; Request = Context.Request;[......]继续阅读

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

public async Task ExecuteAsync(HttpContext context) { Context = context; Request = Context.Request;[......]继续阅读

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

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

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

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

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

第一种: private bool IsDefaultValue(T value) { Span<byte> valueBytes = MemoryMarshal.AsBytes<T>(new T []{ value }.AsSpan());[......]继续阅读

2022年4月3日 0条评论 4546点热度 2人点赞 痴者工良 阅读全文

第一种: private bool IsDefaultValue(T value) { Span<byte> valueBytes = MemoryMarshal.AsBytes<T>(new T []{ value }.AsSpan());[......]继续阅读

2022年4月3日 0条评论 4730点热度 2人点赞 痴者工良 阅读全文

using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; public unsafe class Model { public int Id { get; set[......]继续阅读

2022年3月29日 1条评论 1244点热度 1人点赞 痴者工良 阅读全文

using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; public unsafe class Model { public int Id { get; set[......]继续阅读

2022年3月29日 1条评论 4083点热度 1人点赞 痴者工良 阅读全文

写什么呢 前段时间使用 C# 写了个项目,使用 Kubernetes API Server,获取信息以及监控 Kubernetes 资源,然后结合 Neting 做 API 网关。 体验地址 http://neting.whuanle.cn:30080/ 账号 admin,密码 admin123 [......] 继续阅读

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

What to Write Not long ago, I wrote a project using C#, which utilizes the Kubernetes API Server to retrieve information and monitor Kubernetes resour[......] 继续阅读

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

About Neting Initially, I planned to use Microsoft's official Yarp library to implement an API gateway, but later found it quite cumbersome and decide[......] 继续阅读

2022年1月17日 0条评论 1578点热度 0人点赞 痴者工良 阅读全文
13456716