C# 依賴注入IServiceCollection的AddSingleton方法使用

AddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)方法 這個方法是經過提供一個Func<IServiceProvider,Object>的delegate委託來實現服務的實例獲取。具體怎麼用,下面給一個簡單例子:web using System; using Microsoft.Extensions.Depen
相關文章
相關標籤/搜索