Nimbus.Infrastructure.PathFactory.QueuePathFor C# (CSharp) Method

QueuePathFor() public method

public QueuePathFor ( Type type ) : string
type System.Type
return string
        public string QueuePathFor(Type type)
        {
            var typeName = StripGenericQualification(type);
            var unsanitizedPath = $"{_globalPrefix}{_queuePrefix}.{typeName}";
            var sanitizedPath = Sanitize(unsanitizedPath);
            var path = Shorten(sanitizedPath, MaxPathLength);
            return path;
        }

Usage Example

Exemplo n.º 1
0
        private IEnumerable <string> CheckForDuplicateQueueNames()
        {
            var duplicateQueues = this.AllMessageContractTypes()
                                  .Select(t => new Tuple <string, Type>(PathFactory.QueuePathFor(t), t))
                                  .GroupBy(tuple => tuple.Item1)
                                  .Where(tuple => tuple.Count() > 1)
                                  .ToArray();

            var validationErrors = duplicateQueues
                                   .Select(tuple => "Some message types ({0}) would result in a duplicate queue name of {1}".FormatWith(string.Join(", ", tuple), tuple.Key))
                                   .ToArray();

            return(validationErrors);
        }
All Usage Examples Of Nimbus.Infrastructure.PathFactory::QueuePathFor