IsMessageType() public method

Returns true if the given type is a message type.
public IsMessageType ( Type t ) : bool
t System.Type
return bool
 public IEnumerable <RouteTableEntry> GenerateRoutes(Conventions conventions)
 {
     if (!conventions.IsMessageType(messageType))
     {
         throw new Exception($"Cannot configure routing for type '{messageType.FullName}' because it is not considered a message. Message types have to either implement NServiceBus.IMessage interface or match a defined message convention.");
     }
     yield return(new RouteTableEntry(messageType, route));
 }
Esempio n. 2
0
 public IEnumerable<RouteTableEntry> GenerateRoutes(Conventions conventions)
 {
     if (!conventions.IsMessageType(messageType))
     {
         throw new Exception($"Cannot configure routing for type '{messageType.FullName}' because it is not considered a message. Message types have to either implement NServiceBus.IMessage interface or match a defined message convention.");
     }
     yield return new RouteTableEntry(messageType, route);
 }
Esempio n. 3
0
 public IEnumerable <PublisherTableEntry> GenerateWithoutBestPracticeEnforcement(Conventions conventions)
 {
     if (!conventions.IsMessageType(messageType))
     {
         throw new Exception($"Cannot configure publisher for type '{messageType.FullName}' because it is not considered a message. Message types have to either implement NServiceBus.IMessage interface or match a defined message convention.");
     }
     if (conventions.IsCommandType(messageType))
     {
         throw new Exception($"Cannot configure publisher for type '{messageType.FullName}' because it is a command.");
     }
     yield return(new PublisherTableEntry(messageType, address));
 }
 public IEnumerable<PublisherTableEntry> GenerateWithoutBestPracticeEnforcement(Conventions conventions)
 {
     if (!conventions.IsMessageType(messageType))
     {
         throw new Exception($"Cannot configure publisher for type '{messageType.FullName}' because it is not considered a message. Message types have to either implement NServiceBus.IMessage interface or match a defined message convention.");
     }
     if (conventions.IsCommandType(messageType))
     {
         throw new Exception($"Cannot configure publisher for type '{messageType.FullName}' because it is a command.");
     }
     yield return new PublisherTableEntry(messageType, address);
 }
 public IEnumerable<RouteTableEntry> GenerateRoutes(Conventions conventions)
 {
     var routes = messageAssembly.GetTypes()
         .Where(t => conventions.IsMessageType(t) && string.Equals(t.Namespace, messageNamespace, StringComparison.OrdinalIgnoreCase))
         .Select(t => new RouteTableEntry(t, route))
         .ToArray();
     if (!routes.Any())
     {
         throw new Exception($"Cannot configure routing for namespace {messageNamespace} because it contains no types considered as messages. Message types have to either implement NServiceBus.IMessage interface or match a defined message convention.");
     }
     return routes;
 }
        public IEnumerable <RouteTableEntry> GenerateRoutes(Conventions conventions)
        {
            var routes = messageAssembly.GetTypes()
                         .Where(t => conventions.IsMessageType(t) && string.Equals(t.Namespace, messageNamespace, StringComparison.OrdinalIgnoreCase))
                         .Select(t => new RouteTableEntry(t, route))
                         .ToArray();

            if (!routes.Any())
            {
                throw new Exception($"Cannot configure routing for namespace {messageNamespace} because it contains no types considered as messages. Message types have to either implement NServiceBus.IMessage interface or match a defined message convention.");
            }
            return(routes);
        }
        public IEnumerable<PublisherTableEntry> GenerateWithoutBestPracticeEnforcement(Conventions conventions)
        {
            var entries = messageAssembly.GetTypes()
                .Where(type => conventions.IsMessageType(type) && !conventions.IsCommandType(type))
                .Select(t => new PublisherTableEntry(t, address))
                .ToArray();

            if (!entries.Any())
            {
                throw new Exception($"Cannot configure publisher for assembly {messageAssembly.GetName().Name} because it contains no types considered as messages. Message types have to either implement NServiceBus.IMessage interface or match a defined convention.");
            }

            return entries;
        }
        public IEnumerable <PublisherTableEntry> GenerateWithoutBestPracticeEnforcement(Conventions conventions)
        {
            var entries = messageAssembly.GetTypes()
                          .Where(type => conventions.IsMessageType(type) && !conventions.IsCommandType(type))
                          .Select(t => new PublisherTableEntry(t, address))
                          .ToArray();

            if (!entries.Any())
            {
                throw new Exception($"Cannot configure publisher for assembly {messageAssembly.GetName().Name} because it contains no types considered as messages. Message types have to either implement NServiceBus.IMessage interface or match a defined convention.");
            }

            return(entries);
        }