随笔分类 -  .net

摘要:结论:使用ValueTuple会返回null,Tuple则不会,默认(string,string)这种类型也是ValueTuple 验证 调用方 被调用方 阅读全文
posted @ 2022-06-08 18:38 苏仙一 阅读(38) 评论(0) 推荐(0)
摘要:方案1:循环依赖的服务不直接注入,而是改成用到的地方从容器中获取 public class OrderInfoService { private IServiceProvider _serviceProvider; public OrderInfoService(IServiceProvider s 阅读全文
posted @ 2022-05-23 16:47 苏仙一 阅读(1260) 评论(0) 推荐(0)
摘要:这里用Newtonsoft举例 1、nuget添加引用 Newtonsoft.Json Microsoft.AspNetCore.Mvc.NewtonsoftJson 2、.net5及以下在Startup.net6在Program在AddControllers后添加AddNewtonsoftJson 阅读全文
posted @ 2022-03-31 20:33 苏仙一 阅读(558) 评论(0) 推荐(0)