摘要:
如果服务未注册则GetService()返回null,GetRequiredService()而是抛出异常。 public static T GetService<T>(this IServiceProvider provider) { if (provider == null) { throw n 阅读全文
摘要:
用抽象接口来接收实现是我们代码中常用的一种手段 IBase base = new Child() ,从来没想过在.net Framework下会对性能造成如此影响。 具体代码如下 private static void Test() { Base a = new Base(); AbsBase b 阅读全文