public IEnumerable<RouteTableEntry> GenerateRoutes(Conventions conventions)
{
var routes = messageAssembly.GetTypes()
.Where(t => conventions.IsMessageType(t))
.Select(t => new RouteTableEntry(t, route))
.ToArray();
if (!routes.Any())
{
throw new Exception($"Cannot configure routing 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 message convention.");
}
return routes;
}