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