We get the following error:
'UnicastBusConfig' is obsolete:
'Use of the application configuration file to configure the endpoint is discouraged. Use the code first API instead. Will be treated as an error from version 7.0.0. Will be removed in version 8.0.0
But how do we convert to the below code to the latest version of Nservice bus?
A class implemented IProvideConfiguration
public UnicastBusConfig GetConfiguration()
{
return new UnicastBusConfig
{
MessageEndpointMappings = new MessageEndpointMappingCollection
{
new MessageEndpointMapping { Messages = "Messages.CreateShiftCommand, Shiftex.Messages", Endpoint = "Worker" },
new MessageEndpointMapping { Messages = "ClaimAttemptCommand, Shiftex.Messages", Endpoint = "Worker" }
}
}
};
We saw document saying we need to use something like this
MessageEndpointMapping
var routing = transport.Routing();
routing.RouteToEndpoint(
assembly: typeof(AcceptOrder).Assembly,
destination: "Sales");
but we are using
MessageEndpointMappingCollection -> MessageEndpointMapping
*Message Property *
Endpoint Property
How do convert this code to latest supported code
Could you please help