IFilterFactory

目录

1 IFilterFactory

1.1 /// Copied from MVC Core

2 IInvocation

2.1 /// Copy from Castle.Core.Invocation

  1. IFilterFactory

using System;

namespace Flatwhite.Core

{

/// 

    1. /// Copied from MVC Core

/// 

public interface IFilterFactory

{

/// 

/// Creates an instance of the MethodFilterAttribute"/> filter.

/// 

/// serviceProvider">The request IServiceProvider"/>.

/// An instance of the executable filter.

MethodFilterAttribute CreateInstance(IServiceProvider serviceProvider);

}

}

  1. IInvocation

using System;

using System.Reflection;

namespace Flatwhite.Core

{

    /// 

    1.     /// Copy from Castle.Core.Invocation

    /// 

    public interface IInvocation

    {

        object[] Arguments { get; }

        Type[] GenericArguments { get; }

        object InvocationTarget { get; }

        MethodInfo Method { get; }

        MethodInfo MethodInvocationTarget { get; }

        object Proxy { get; }

        object ReturnValue { get; set; }

        Type TargetType { get; }

    void Proceed();

    }

internal class Invocation : IInvocation

{

public object[] Arguments { get; set;}

public Type[] GenericArguments { get; set;}

public object InvocationTarget { get; set;}

public MethodInfo Method { get; set;}

public MethodInfo MethodInvocationTarget { get; set;}

public object Proxy { get; set;}

public object ReturnValue { get; set; }

public Type TargetType { get; set;}

public void Proceed()

{

ReturnValue = Method.Invoke(InvocationTarget, Arguments);

}

}

}

你可能感兴趣的:(Flatwhite,Flatwhite)