public bool IsMessageType(Type t)
{
Guard.AgainstNull(nameof(t), t);
try
{
return MessagesConventionCache.ApplyConvention(t,
typeHandle =>
{
var type = Type.GetTypeFromHandle(typeHandle);
if (IsInSystemConventionList(type))
{
return true;
}
if (type.IsFromParticularAssembly())
{
return false;
}
return IsMessageTypeAction(type) ||
IsCommandTypeAction(type) ||
IsEventTypeAction(type);
});
}
catch (Exception ex)
{
throw new Exception("Failed to evaluate Message convention. See inner exception for details.", ex);
}
}