摘要: 提问 如何WebApi 设置字段序列化别名 回答 [JsonProperty(PropertyName = "access_token"), JsonPropertyName("access_token")] 阅读全文
posted @ 2023-04-13 17:04 喜爱糖葫芦 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 提问 C# 如何获取下个月 回答 int year=2022; int month=10; new DateTime(year, trace.Month, 1, 0, 0, 0, 0).AddMonths(1); 千万不要,因为在month=12时直接报错 int year=2022; int mo 阅读全文
posted @ 2023-04-13 15:26 喜爱糖葫芦 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 提问 C# Channel有哪些技巧 回答 判断管道中是否还有任务 return _channel.Reader.Count > 0; 结合Channel.CreateUnbounded (无边界管道)可实现整体任务缓存,避免重复写入 慎用ChannelWriter.Complete 这会造成管道关 阅读全文
posted @ 2023-04-13 09:56 喜爱糖葫芦 阅读(73) 评论(0) 推荐(0) 编辑