protected override void Setup(FeatureConfigurationContext context)
    {
        var transportInfrastructure = context.Settings.Get <TransportInfrastructure>();

        var endpoint = new NServiceBus.Routing.EndpointInstance("Samples.SqlServer.TruncateReceiver");

        var connectionString = @"Data Source=.\SqlExpress;Database=SQLServerTruncate;Integrated Security=True;Max Pool Size=100";

        SqlHelper.TruncateMessageTable(connectionString, transportInfrastructure.ToTransportAddress(LogicalAddress.CreateRemoteAddress(endpoint)));
    }
예제 #2
0
 bool Equals(EndpointInstance other)
 {
     return(PropertiesEqual(Properties, other.Properties) &&
            Equals(Endpoint, other.Endpoint) &&
            string.Equals(Discriminator, other.Discriminator));
 }
 /// <summary>
 /// Converts a given logical address to the transport address.
 /// </summary>
 /// <param name="endpointInstance">The endpoint instance.</param>
 /// <returns>The transport address.</returns>
 public string ToTransportAddress(EndpointInstance endpointInstance)
 {
     return(addressTranslation(endpointInstance));
 }
예제 #4
0
 /// <summary>
 /// Converts a given logical address to the transport address.
 /// </summary>
 /// <param name="endpointInstance">The endpoint instance.</param>
 /// <returns>The transport address.</returns>
 public string ToTransportAddress(EndpointInstance endpointInstance)
 {
     Guard.AgainstNull(nameof(endpointInstance), endpointInstance);
     return(addressTranslation(endpointInstance));
 }
예제 #5
0
 /// <summary>
 /// Creates a destination based on the name of the endpoint instance.
 /// </summary>
 /// <param name="instance">Destination instance name.</param>
 public UnicastRoute(EndpointInstance instance)
 {
     Guard.AgainstNull(nameof(instance), instance);
     this.instance = instance;
 }