上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 44 下一页
摘要: 提问 属性字段为什么要在构造函数中初始化 回答 假如一只猫来到这个世界上那么他的爪子,尾巴应该是完好的,而不是缺失的 阅读全文
posted @ 2023-04-19 09:29 喜爱糖葫芦 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 提问 属性与字段的区别 回答 公开属性使用字段代替; 私有成员使用私有字段; 属性可以有更精细化控制 参考 阅读全文
posted @ 2023-04-18 08:46 喜爱糖葫芦 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 提问 blazor如何设置定时任务刷新页面 回答 1.使用Timer 2. 触发页面状态已经改变 InvokeAsync(StateHasChanged); protected override async Task OnInitializedAsync() { try { base.OnIniti 阅读全文
posted @ 2023-04-17 15:46 喜爱糖葫芦 阅读(1031) 评论(0) 推荐(0) 编辑
摘要: 提问 标准的WebApi应该有哪些元素 回答 声明完整的响应码200,404,401,400 添加Operation 添加Tag聚合业务 申明请求和响应类型 标注参数来源FromHeader 使用ActionResult 代替IActionResult 简化 [ProducesResponseTyp 阅读全文
posted @ 2023-04-15 14:17 喜爱糖葫芦 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 提问 如何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) 编辑
摘要: 提问 线程中的终极异常处理处理 回答 为了异常阻塞主线程是不值得的 使用事件通知方式,这样不会阻塞主线程 捕捉AggregateException 阅读全文
posted @ 2023-04-11 08:54 喜爱糖葫芦 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 提问 wix服务恢复 回答 <?xml version="1.0" encoding="UTF-8"?> <?include Configuration.wxi?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="h 阅读全文
posted @ 2023-04-10 15:10 喜爱糖葫芦 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 提问 如何写列表example注释 回答 使用[] 示例 /// <summary> /// 集合 /// </summary> /// <example>["asdfasdfeadfadf"]</example> public List<string>? Orders{ get; set; } 阅读全文
posted @ 2023-04-10 13:26 喜爱糖葫芦 阅读(13) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 44 下一页