02 2023 档案
摘要:这些东西以前是知道是什么东西,但是没做记录现在就忘了,还是做下记录好点分布式:将一个大系统分为若干小系统,例如我现在的维护流程系统,简单分 可以流程一个,微信端一个。在细一点,流程后台中流程设计为一个,表单设计一个,前台流程解释执行一个.拆开部署到不同服务器支之间相互访问微服务 :也是将将服务拆分,
阅读全文
摘要:准备要注册的对象 和接口,以及注册的生命周期 准备注册,先检查 是否释放 检测是否 已注册,没有则添加到 集合内并反回对象 创建服务提供工程。初始化容器,根据注入的对象类型选择不同的注册方式 1 通过据提的接口和实现类 2 直接new 对象的 3 通过实例工厂创建 使用 1 的会直接注册委托Crea
阅读全文
摘要:服务的创建在创建对象时有多个构造函数符合条件,会报错System.InvalidOperationException:“Unable to activate type 'App.Qux'. The following constructors are ambiguous:要有唯一的才行 new Se
阅读全文
摘要:服务范围有效性检查var root = new ServiceCollection() .AddSingleton<IFoo, Foo>() .AddScoped<IBar, Bar>() .BuildServiceProvider(true);//是否是单例转为 瞬时或者范围,对服务范围的有效性检
阅读全文
摘要:using App; using System.Diagnostics; var cat = new Cat() .Register<IFoo, Foo>(Lifetime.Transient) .Register<IBar, Bar>(Lifetime.Transient) .Register(t
阅读全文
摘要:public T Query<T>(int id) where T : BaseModel { Type type = typeof(T); string columnString = string.Join(",", type.GetProperties().Select(p => $"[{p.G
阅读全文
摘要:绑定集合 var source = new Dictionary<string, string> { ["0:gender"] = "Male", //["0:age"] = "18", //["0:contactInfo:emailAddress"] = "foo@outlook.com", //
阅读全文