上一页 1 2 3 4 5 6 7 8 ··· 89 下一页
摘要: 手动获取IServiceProvider依赖注入的 服务实例 Task.Run(() => { try { //Task里创建了新的IServiceScope using var scope = _scopeFactory.CreateScope(); //通过IServiceScope创建具体实例 阅读全文
posted @ 2022-11-23 10:53 BloggerSb 阅读(732) 评论(0) 推荐(0)
摘要: //.netcore 使用log4net替换ILooger实现 services.AddLogging(logBuilder => { logBuilder.ClearProviders(); logBuilder.AddLog4Net("log4net.config"); }); 使用log4ne 阅读全文
posted @ 2022-11-23 09:27 BloggerSb 阅读(466) 评论(0) 推荐(0)
摘要: public class DependencyInjection { public static DependencyInjection Instance { get; private set; } static DependencyInjection() { Instance = new Depe 阅读全文
posted @ 2022-11-23 09:16 BloggerSb 阅读(30) 评论(0) 推荐(0)
摘要: private readonly IScheduler scheduler; //scheduler = StdSchedulerFactory.GetDefaultScheduler().GetAwaiter().GetResult(); //非静态使用 scheduler = _serviceP 阅读全文
posted @ 2022-11-23 09:13 BloggerSb 阅读(66) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-11-05 16:44 BloggerSb 阅读(33) 评论(0) 推荐(0)
摘要: alter table news modify column title varchar(130); alter table 表名 modify column 字段名 类型; 如:news 表里的title 字段 原来长度是 100个字符,现长度要改成130个字符 alter table news 阅读全文
posted @ 2022-10-08 13:54 BloggerSb 阅读(423) 评论(0) 推荐(0)
摘要: HttpClientFactory 创建的HttpClient,也即是HttpClientHandler,只是这些个HttpClient被放到了“池子”中,工厂每次在create的时候会自动判断是新建还是复用。(默认生命周期为2min,默认的生命周期可以修改) 第一种使用方式 在Startup.cs 阅读全文
posted @ 2022-09-23 11:33 BloggerSb 阅读(193) 评论(0) 推荐(0)
摘要: 原因及解决方法,参考: https://blog.csdn.net/nihaoapengyou/article/details/52587986 网上也有对应的Dll提供,但对8.0无效,但我是我没找到。可能是因为7.0版本软件没有对Dll进行强签名,而8.0开始做了。 怎么办?思路还是跟参考的一样 阅读全文
posted @ 2022-09-13 09:51 BloggerSb 阅读(136) 评论(0) 推荐(0)
摘要: using System.Reflection; Type t = obj.GetType();//获得该类的Type foreach (PropertyInfo pi in t.GetProperties()) { var name = pi.Name;//获得属性的名字,后面就可以根据名字判断来 阅读全文
posted @ 2022-09-07 15:41 BloggerSb 阅读(794) 评论(0) 推荐(0)
摘要: 修改项目文件增加 <RazorCompileOnBuild>false</RazorCompileOnBuild> <RazorCompileOnPublish>false</RazorCompileOnPublish>编辑Startup.cspublic void ConfigureService 阅读全文
posted @ 2022-07-28 09:37 BloggerSb 阅读(78) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 89 下一页