ASP Net Core-依赖注入-跟踪对象解析

时间:2018-10-25 12:21:00

标签: c# asp.net-core .net-core

出于调试目的,是否有一种方法可以跟踪Asp Net Core中的依赖关系框架在什么范围内解析了哪种类型?

关注IServiceProviderEngineCallback

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;

namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
{
    internal interface IServiceProviderEngineCallback
    {
        void OnCreate(IServiceCallSite callSite);
        void OnResolve(Type serviceType, IServiceScope scope);
    }
 }

和其他内部类...有没有办法钩入“ OnResolve”?

0 个答案:

没有答案