/// <summary> /// Returns true if the given type is a command type. /// </summary> public bool IsCommandType(Type t) { Guard.AgainstNull(nameof(t), t); try { return(CommandsConventionCache.ApplyConvention(t, typeHandle => { var type = Type.GetTypeFromHandle(typeHandle); if (type.IsFromParticularAssembly()) { return false; } foreach (var convention in conventions) { if (convention.IsCommandType(type)) { if (logger.IsDebugEnabled) { logger.Debug($"{type.FullName} identified as command type by {convention.Name} convention."); } return true; } } return false; })); } catch (Exception ex) { throw new Exception("Failed to evaluate Command convention. See inner exception for details.", ex); } }
/// <summary> /// Returns true if the given type is a command type. /// </summary> public static bool IsCommandType(Type t) { try { return(CommandsConventionCache.ApplyConvention(t, type => IsCommandTypeAction(type))); } catch (Exception ex) { throw new MessageConventionException("Failed to evaluate Command convention. See inner exception for details.", ex); } }
/// <summary> /// Returns true if the given type is a command type. /// </summary> /// <param name="t"></param> /// <returns></returns> public static bool IsCommandType(this Type t) { try { return(CommandsConventionCache.ApplyConvention(t, type => IsCommandTypeAction(type))); } catch (Exception ex) { Logger.Error("Failed to evaluate Command convention: " + ex); throw; } }
/// <summary> /// Returns true if the given type is a command type. /// </summary> public bool IsCommandType(Type t) { try { return(CommandsConventionCache.ApplyConvention(t, type => { if (type.IsFromParticularAssembly()) { return false; } return IsCommandTypeAction(type); })); } catch (Exception ex) { throw new Exception("Failed to evaluate Command convention. See inner exception for details.", ex); } }
/// <summary> /// Returns true if the given type is a command type. /// </summary> public bool IsCommandType(Type t) { Guard.AgainstNull(nameof(t), t); try { return(CommandsConventionCache.ApplyConvention(t, typeHandle => { var type = Type.GetTypeFromHandle(typeHandle); if (type.IsFromParticularAssembly()) { return false; } return IsCommandTypeAction(type); })); } catch (Exception ex) { throw new Exception("Failed to evaluate Command convention. See inner exception for details.", ex); } }
/// <summary> /// Returns true if the given type is a command type. /// </summary> /// <param name="t"></param> /// <returns></returns> public static bool IsCommandType(this Type t) { return(CommandsConventionCache.ApplyConvention(t, type => IsCommandTypeAction(type))); }