Nimbus.Infrastructure.PathFactory.TopicPathFor C# (CSharp) Метод

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

public TopicPathFor ( Type type ) : string
type System.Type
Результат string
        public string TopicPathFor(Type type)
        {
            var typeName = StripGenericQualification(type);
            var unsanitizedPath = $"{_globalPrefix}{_topicPrefix}.{typeName}";
            var sanitizedPath = Sanitize(unsanitizedPath);
            var path = Shorten(sanitizedPath, MaxPathLength);
            return path;
        }

Usage Example

Пример #1
0
 public void WhenCreatingAQueue_WeShouldConvertToLowerCase()
 {
     var pathFactory = new PathFactory(new GlobalPrefixSetting());
     var path = pathFactory.TopicPathFor(typeof(MyEscapingTestMessages.EscapingTestMessage));
     var expectedName = "t." + typeof(MyEscapingTestMessages.EscapingTestMessage).FullName.Replace("+", ".").ToLower();
     path.ShouldBe(expectedName);
 }
All Usage Examples Of Nimbus.Infrastructure.PathFactory::TopicPathFor