IsEventType() публичный Метод

Returns true if the given type is a event type.
public IsEventType ( Type t ) : bool
t System.Type
Результат bool
Пример #1
0
 public IEnumerable <PublisherTableEntry> GenerateWithBestPracticeEnforcement(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.IsEventType(messageType))
     {
         throw new Exception($"Cannot configure publisher for type '{messageType.FullName}' because it is not considered an event. Event types have to either implement NServiceBus.IEvent interface or match a defined event convention.");
     }
     yield return(new PublisherTableEntry(messageType, address));
 }
Пример #2
0
 public IEnumerable<PublisherTableEntry> GenerateWithBestPracticeEnforcement(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.IsEventType(messageType))
     {
         throw new Exception($"Cannot configure publisher for type '{messageType.FullName}' because it is not considered an event. Event types have to either implement NServiceBus.IEvent interface or match a defined event convention.");
     }
     yield return new PublisherTableEntry(messageType, address);
 }
        public IEnumerable <PublisherTableEntry> GenerateWithBestPracticeEnforcement(Conventions conventions)
        {
            var entries = messageAssembly.GetTypes()
                          .Where(t => conventions.IsEventType(t) && string.Equals(t.Namespace, messageNamespace, StringComparison.OrdinalIgnoreCase))
                          .Select(t => new PublisherTableEntry(t, address))
                          .ToArray();

            if (!entries.Any())
            {
                throw new Exception($"Cannot configure publisher for namespace {messageNamespace} because it contains no types considered as events. Event types have to either implement NServiceBus.IEvent interface or match a defined event convention.");
            }

            return(entries);
        }
        public IEnumerable<PublisherTableEntry> GenerateWithBestPracticeEnforcement(Conventions conventions)
        {
            var entries = messageAssembly.GetTypes()
                .Where(t => conventions.IsEventType(t) && string.Equals(t.Namespace, messageNamespace, StringComparison.OrdinalIgnoreCase))
                .Select(t => new PublisherTableEntry(t, address))
                .ToArray();

            if (!entries.Any())
            {
                throw new Exception($"Cannot configure publisher for namespace {messageNamespace} because it contains no types considered as events. Event types have to either implement NServiceBus.IEvent interface or match a defined event convention.");
            }

            return entries;
        }