会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
孤海飞雁
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
5
6
7
8
9
10
11
12
下一页
2023年2月9日
C# 委托
摘要: public T Query<T>(int id) where T : BaseModel { Type type = typeof(T); string columnString = string.Join(",", type.GetProperties().Select(p => $"[{p.G
阅读全文
posted @ 2023-02-09 10:12 孤海飞雁
阅读(19)
评论(0)
推荐(0)
2023年2月2日
Net6 ConfigurationBinder configuration转为对象(未完成)
摘要: 绑定集合 var source = new Dictionary<string, string> { ["0:gender"] = "Male", //["0:age"] = "18", //["0:contactInfo:emailAddress"] = "foo@outlook.com", //
阅读全文
posted @ 2023-02-02 22:36 孤海飞雁
阅读(62)
评论(0)
推荐(0)
2022年11月2日
VS Code 调试 NETCore 热更新(HotReload)
摘要: { // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ {
阅读全文
posted @ 2022-11-02 18:37 孤海飞雁
阅读(708)
评论(1)
推荐(0)
2022年10月17日
IOC生命周期 -3种生命周期
摘要: IServiceProvider 处理提供所需服务实例,有需要还会负责释放服务实例。具体操作为调试用实例的dispose或者异步dispose方法。 scoped和transient:当前Iservice provider 对象 调用dispose 方法,实例方法 dispose 也被调用,随之释放
阅读全文
posted @ 2022-10-17 22:19 孤海飞雁
阅读(334)
评论(0)
推荐(0)
IOC 生命周期-服务范围
摘要: public class ServicesPrpvoder:IServicesPrpvoder 服务提供者可以利用IserviceScoprFactory 创建一个 服务范围 IServiceScope对象IServicesScope 的包含IServicesPrpvoder任何一个 IServic
阅读全文
posted @ 2022-10-17 21:27 孤海飞雁
阅读(64)
评论(0)
推荐(0)
2022年10月12日
IOC 校验
摘要: var sc = new ServiceCollection() .AddScoped<IA, A>() .AddSingleton<IB, B>() .AddTransient<IC, C>() .BuildServiceProvider(true);//ValidateScopes检查在scop
阅读全文
posted @ 2022-10-12 22:00 孤海飞雁
阅读(31)
评论(0)
推荐(0)
2022年10月11日
IOC 根容器和子容器
摘要: 通过上图可知, 容器中 Transient 的foo 被每个容器创建,scoped 的 ber 也在每个容器中创建 ,二 单例的 baz 只在根容器中创建
阅读全文
posted @ 2022-10-11 21:43 孤海飞雁
阅读(31)
评论(0)
推荐(0)
2022年10月10日
IOC 生命周期和释放
摘要: 使用ServiceCollection 注入AddTransient,AddScoped,AddSingleton 三不同生命周期的的对象 Transient 最先释放 Scope 随后 Singleton 最后 using (var sc = new ServiceCollection() .Ad
阅读全文
posted @ 2022-10-10 22:10 孤海飞雁
阅读(152)
评论(0)
推荐(0)
2022年9月24日
ABP V7使用-1
摘要: 从官方下载模板Startup Templates - Create a Demo | AspNet Boilerplate 里面前后端,我的时V7.X+NET6+VUE版本的模板 1 打开后端,更换数据库连接,运行可能会报下面这个错误,要建表后运行,不然会报错ABP 什么错误的 可能会报这个错误上图
阅读全文
posted @ 2022-09-24 18:26 孤海飞雁
阅读(242)
评论(0)
推荐(0)
2022年9月20日
Net RunTIme Microsoft.Extensions.DependencyInjection 调试报错修复
摘要: 重新生成时直接报错,报错项目可直接找到,运行没问题。D:\SourceCode\Net\Runtime2\src\libraries\Common\tests\TestUtilities\TestUtilities.csproj //注释代码 <ItemGroup Condition="'$(Tar
阅读全文
posted @ 2022-09-20 20:07 孤海飞雁
阅读(182)
评论(0)
推荐(0)
上一页
1
···
5
6
7
8
9
10
11
12
下一页
公告