internal static IAspectConfigureOption <bool> IgnoreEntityFramework(this IAspectConfigureOption <bool> option) { option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.Data.*")); option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.EntityFrameworkCore")); option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.EntityFrameworkCore.*")); return(option); }
public static IEnumerable <TInterceptor> Aggregate <TInterceptor>( MethodInfo methodInfo, TypeInfo typeInfo, IAspectConfigureOption <IInterceptor> configureOption) where TInterceptor : class, IInterceptor { foreach (var option in configureOption) { var interceptor = option(methodInfo) as TInterceptor; if (interceptor != null) { yield return(interceptor); } } foreach (var attribute in typeInfo.GetCustomAttributes()) { var interceptor = attribute as TInterceptor; if (interceptor != null) { yield return(interceptor); } } foreach (var attribute in methodInfo.GetCustomAttributes()) { var interceptor = attribute as TInterceptor; if (interceptor != null) { yield return(interceptor); } } }
internal static IAspectConfigureOption <bool> IgnoreObjectVMethod(this IAspectConfigureOption <bool> option) { option.Add(method => method.Name.Matches("Equals")); option.Add(method => method.Name.Matches("GetHashCode")); option.Add(method => method.Name.Matches("ToString")); option.Add(method => method.Name.Matches("GetType")); return(option); }
internal static IAspectConfigureOption <bool> IgnoreAspNetCore(this IAspectConfigureOption <bool> option) { option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.AspNetCore.*")); option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.AspNet.*")); option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.Extensions.*")); option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.ApplicationInsights.*")); option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.Net.*")); option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.Web.*")); return(option); }
internal static IAspectConfigureOption <bool> IgnoreSystem(this IAspectConfigureOption <bool> option) { option.Add(method => method.DeclaringType.Namespace.Matches("System")); option.Add(method => method.DeclaringType.Namespace.Matches("System.*")); return(option); }
internal static IAspectConfigureOption <bool> IgnorePageGenerator(this IAspectConfigureOption <bool> option) { option.Add(method => method.DeclaringType.Namespace.Matches("PageGenerator")); return(option); }
internal static IAspectConfigureOption <bool> IgnoreOwin(this IAspectConfigureOption <bool> option) { option.Add(method => method.DeclaringType.Namespace.Matches("Microsoft.Owin.*")); option.Add(method => method.DeclaringType.Namespace.Matches("Owin")); return(option); }
public static bool HasInterceptor <T>(IAspectConfigureOption <IInterceptor> aspectConfigure, MethodInfo method) where T : class, IInterceptor { return(aspectConfigure.Any(config => (config(method) as T) != null)); }
public static bool IsIgnored(IAspectConfigureOption <bool> ignores, MethodInfo method) { return(ignores.Any(configure => configure(method))); }