Table of Contents

Class StringExtensions

Namespace
Savvyio.Extensions.SimpleQueueService.EventDriven
Assembly
Savvyio.Extensions.SimpleQueueService.dll

Extension methods for the string class.

public static class StringExtensions
Inheritance
StringExtensions

Examples

Use StringExtensions.ToSnsUri to convert an SNS topic name to a Uri formatted as an Amazon Resource Name (ARN) for use as the event bus source.

using System;
using Savvyio.Extensions.SimpleQueueService.EventDriven;

namespace ExampleApp;

public class SnsUriExample
{
    public static Uri BuildSnsTopicUri()
    {
        var topicArn = "account-events".ToSnsUri(options =>
        {
            options.Partition = "aws";
            options.Region = "eu-west-1";
            options.AccountId = "123456789012";
        });
        return topicArn;
    }
}

Methods

ToSnsUri(string, Action<AmazonResourceNameOptions>)

Converts the specified source to its equivalent AWS ARN Uri representation.

public static Uri ToSnsUri(this string source, Action<AmazonResourceNameOptions> setup = null)

Parameters

source string

The string to extend.

setup Action<AmazonResourceNameOptions>

The AmazonResourceNameOptions which may be configured.

Returns

Uri

A Uri that corresponds to source and setup.