# MessageId.ToString(string?, IFormatProvider?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.messageid/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.messageid/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Messaging/MessageId.cs#L83)

```csharp
public string ToString(string? format, IFormatProvider? formatProvider)
```

Formats the value of the current instance using the specified format.

### Parameters

- `format` (`string?`): The format to use. -or- A null reference (`Nothing` in Visual Basic) to use the default format defined for the type of the `System.IFormattable` implementation.
- `formatProvider` (`IFormatProvider?`): The provider to use to format the value. -or- A null reference (`Nothing` in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

### Returns

The value of the current instance in the specified format.
