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<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); }