惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
B
Blog RSS Feed
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
博客园 - 司徒正美
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
D
Docker
Blog — PlanetScale
Blog — PlanetScale
Recent Announcements
Recent Announcements
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
腾讯CDC
T
The Blog of Author Tim Ferriss
小众软件
小众软件
U
Unit 42
T
Tailwind CSS Blog

博客园 - 咒语

Azure OAuth2 PostMan 授权代码 跨线程 操作Winform 主UI时的扩展方法 每当双11来时,商家与京东的那些骚操作,京东30天保价不能信 EasyToLearnDesignPattern C#中关于表达式与委托在EF中的不同表现总结 软件开发中的版本号 The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported. ABP项目依赖图,根据自已生在的Demo项目分析而得 学习ELk之----02. Elastic Search操作入门 学习ELK之----01.建立ELK测试项目 一目了然呀的VS2017 Live Test 在Hyper-V上安装RemixOS 的Android模拟器 配置Asp.Net Web项目NLog配置文件的位置 配置WinRM的Https 测试EntityFramework,Z.EntityFramework.Extensions,原生语句在不同的查询中的表现。原来池化与非池化设定是有巨大的影响的。 消费RabbitMQ时的注意事项,如何禁止大量的消息涌到Consumer RabbitMQ调试与测试工具-v1.0.1 -提供下载测试与使用 安装TFS2015后启用生成功能 log4net在Realse下有个好大的坑呀。
Microsoft.Extensions.DependencyInjection 阅读笔记
咒语 · 2019-05-10 · via 博客园 - 咒语

2019-05-10 15:16  咒语  阅读(1624)  评论()    收藏  举报

一、 关于IServiceCollection接口的设计

 public interface IServiceCollection : IList<ServiceDescriptor>
    {
    }

a. 为什么不直接用List<>集合,而要重新定义一个这样的IServiceCollection接口呢?

1. 为了从IList<>那里得到所有的List集合的可重载方法;
2. 有了自已的名字IServiceCollection,而不是List<>这样直接使用,如果直接继承了List<>的话,那么在使用的时候,你用这个List<>根本就不知道这是干啥的,并且还要带上参数;

 二、关于调试时的跟踪

[DebuggerDisplay("Lifetime = {Lifetime}, ServiceType = {ServiceType}, ImplementationType = {ImplementationType}")]
 public class ServiceDescriptor

a. 加上DebuggerDisplay特性,然后用{}把属性名称显出来了即可,在跟踪Stack中你就能看到想要显示的效果了。

未完.....