MethodExceptionContext

目录

1 MethodFilterAttribute

1.1 /// Represents the base class for all method-filter attributes.

1.1.1 /// Occurs before the action method is invoked.

1.1.2 ///  Occurs after the action method is invoked.

  1. MethodFilterAttribute 

using System;

using System.Diagnostics;

using System.Threading.Tasks;

namespace Flatwhite.Core

{

    /// 

    1.     /// Represents the base class for all method-filter attributes.

    /// 

    [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]

    public abstract class MethodFilterAttribute : Attribute

    {

        /// 

        /// Gets or sets the order in which the action filters are executed.

        /// 

        public int Order { get; set; }

        /// 

        /// Occurs before the action method is invoked.

        /// 

        /// methodExecutingContext">

        [DebuggerStepThrough]

        public virtual void OnMethodExecuting(MethodExecutingContext methodExecutingContext)

        {

        }

        /// 

      1.         /// Occurs before the action method is invoked.

        /// 

        /// methodExecutingContext">

        /// 

        [DebuggerStepThrough]

        public virtual Task OnMethodExecutingAsync(MethodExecutingContext methodExecutingContext)

        {

            OnMethodExecuting(methodExecutingContext);

        return Task.CompletedTask;

        }

        /// 

        ///  Occurs after the action method is invoked.

        /// 

        /// methodExecutedContext">

        [DebuggerStepThrough]

        public virtual void OnMethodExecuted(MethodExecutedContext methodExecutedContext)

        {

        }

        /// 

      1.         ///  Occurs after the action method is invoked.

        /// 

        /// methodExecutedContext">

        /// 

        [DebuggerStepThrough]

        public virtual Task OnMethodExecutedAsync(MethodExecutedContext methodExecutedContext)

        {

            OnMethodExecuted(methodExecutedContext);

return Task.CompletedTask;

        }

    }

}

你可能感兴趣的:(Flatwhite,java,android,开发语言,Flatwhite)