当集合为 null 时,代码如下: List<int>? _a = null; List<int>? _b = null; var a = _a?.Any() == false;[......]继续阅读
When the collection is null, the code is as follows: List<int>? _a = null; List<int>? _b = null; var[......]继续阅读
[ThreadStatic] private static bool HasCreated = false; [ThreadStatic] private static int Value = 0; void Main() { Console.WriteLine(Thread.Curren[......]继续阅读
如下面代码: [ThreadStatic] private bool HasCreated = false; [ThreadStatic] private int Value = 0; void Main() { ThreadLocal<string> a = new Thre[......]继续阅读
Directory Structure: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API ### Template Directory 1. Create an empty[......]继续阅读
Define the Converter: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return obj[......]继续阅读
定义转换器: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return object[......]继续阅读
public async Task ExecuteAsync(HttpContext context) { Context = context; Request = Context.Request;[......]继续阅读
public async Task ExecuteAsync(HttpContext context) { Context = context; Request = Context.Request;[......]继续阅读
private static readonly Encoding UTF8NoBOM = new UTF8Encoding( encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); [......] 继续阅读
private static readonly Encoding UTF8NoBOM = new UTF8Encoding( encoderShouldEmitUTF8Identifier: false, throwOnInvali[......]继续阅读
第一种: private bool IsDefaultValue(T value) { Span<byte> valueBytes = MemoryMarshal.AsBytes<T>(new T []{ value }.AsSpan());[......]继续阅读
第一种: private bool IsDefaultValue(T value) { Span<byte> valueBytes = MemoryMarshal.AsBytes<T>(new T []{ value }.AsSpan());[......]继续阅读
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; public unsafe class Model { public int Id { get; set[......]继续阅读
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; public unsafe class Model { public int Id { get; set[......]继续阅读
写什么呢 前段时间使用 C# 写了个项目,使用 Kubernetes API Server,获取信息以及监控 Kubernetes 资源,然后结合 Neting 做 API 网关。 体验地址 http://neting.whuanle.cn:30080/ 账号 admin,密码 admin123 [......] 继续阅读
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[......] 继续阅读
关于 Neting 刚开始的时候是打算使用微软官方的 Yarp 库,实现一个 API 网关,后面发现坑比较多,弄起来比较麻烦,就放弃了。目前写完了查看 Kubernetes Service 信息、创建 Route 和 Cluster 和绑定 Kubernetes Service。简单来说,就是完成了[......] 继续阅读
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[......] 继续阅读