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

SubscriptionNameFor() public method

public SubscriptionNameFor ( string applicationName, Type handlerType ) : string
applicationName string
handlerType System.Type
return string
        public string SubscriptionNameFor(string applicationName, Type handlerType)
        {
            var unsanitizedName = $"{applicationName}.{handlerType.Name}";
            var sanitizedName = Sanitize(unsanitizedName);
            var name = Shorten(sanitizedName, MaxNameLength);
            return name;
        }

Same methods

PathFactory::SubscriptionNameFor ( string applicationName, string instanceName, Type handlerType ) : string

Usage Example

Ejemplo n.º 1
0
 public void WhenCreatingASubscriptionForATypeASpaceShouldBeConvertedToTheSanitizeCharacter()
 {
     var pathFactory = new PathFactory(new GlobalPrefixSetting());
     var subscriptionName = pathFactory.SubscriptionNameFor("My App", "App server", typeof(MyEventWithALongName));
     subscriptionName.ShouldBe("my.app.app.server.myeventwithalongname");
 }
All Usage Examples Of Nimbus.Infrastructure.PathFactory::SubscriptionNameFor