/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogDebug(0, exception, "Error while processing request from {Address}", address)</example>
public static void LogDebug(this ILogger logger, EventId eventId, Exception exception, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogDebug(0, "Processing request from {Address}", address)</example>
public static void LogDebug(this ILogger logger, EventId eventId, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogDebug(exception, "Error while processing request from {Address}", address)</example>
public static void LogDebug(this ILogger logger, Exception exception, string message, params object[] args)
/// Formats and writes a debug log message.
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogDebug("Processing request from {Address}", address)</example>
public static void LogDebug(this ILogger logger, string message, params object[] args)
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogTrace(0, exception, "Error while processing request from {Address}", address)</example>
public static void LogTrace(this ILogger logger, EventId eventId, Exception exception, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogTrace(0, "Processing request from {Address}", address)</example>
public static void LogTrace(this ILogger logger, EventId eventId, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogTrace(exception, "Error while processing request from {Address}", address)</example>
public static void LogTrace(this ILogger logger, Exception exception, string message, params object[] args)
/// Formats and writes a trace log message.
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogTrace("Processing request from {Address}", address)</example>
public static void LogTrace(this ILogger logger, string message, params object[] args)
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogInformation(0, exception, "Error while processing request from {Address}", address)</example>
public static void LogInformation(this ILogger logger, EventId eventId, Exception exception, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogInformation(0, "Processing request from {Address}", address)</example>
public static void LogInformation(this ILogger logger, EventId eventId, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogInformation(exception, "Error while processing request from {Address}", address)</example>
public static void LogInformation(this ILogger logger, Exception exception, string message, params object[] args)
/// Formats and writes an informational log message.
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogInformation("Processing request from {Address}", address)</example>
public static void LogInformation(this ILogger logger, string message, params object[] args)
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogWarning(0, exception, "Error while processing request from {Address}", address)</example>
public static void LogWarning(this ILogger logger, EventId eventId, Exception exception, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogWarning(0, "Processing request from {Address}", address)</example>
public static void LogWarning(this ILogger logger, EventId eventId, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogWarning(exception, "Error while processing request from {Address}", address)</example>
public static void LogWarning(this ILogger logger, Exception exception, string message, params object[] args)
/// Formats and writes a warning log message.
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogWarning("Processing request from {Address}", address)</example>
public static void LogWarning(this ILogger logger, string message, params object[] args)
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogError(0, exception, "Error while processing request from {Address}", address)</example>
public static void LogError(this ILogger logger, EventId eventId, Exception exception, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogError(0, "Processing request from {Address}", address)</example>
public static void LogError(this ILogger logger, EventId eventId, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogError(exception, "Error while processing request from {Address}", address)</example>
public static void LogError(this ILogger logger, Exception exception, string message, params object[] args)
/// Formats and writes an error log message.
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogError("Processing request from {Address}", address)</example>
public static void LogError(this ILogger logger, string message, params object[] args)
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogCritical(0, exception, "Error while processing request from {Address}", address)</example>
public static void LogCritical(this ILogger logger, EventId eventId, Exception exception, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="eventId">The event id associated with the log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogCritical(0, "Processing request from {Address}", address)</example>
public static void LogCritical(this ILogger logger, EventId eventId, string message, params object[] args)
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
/// <param name="exception">The exception to log.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogCritical(exception, "Error while processing request from {Address}", address)</example>
public static void LogCritical(this ILogger logger, Exception exception, string message, params object[] args)
/// Formats and writes a critical log message.
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to write to.</param>
- /// <param name="message">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="message">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <example>logger.LogCritical("Processing request from {Address}", address)</example>
public static void LogCritical(this ILogger logger, string message, params object[] args)
/// Formats the message and creates a scope.
/// </summary>
/// <param name="logger">The <see cref="ILogger"/> to create the scope in.</param>
- /// <param name="messageFormat">Format string of the log message in message template format. Example: <code>"User {User} logged in from {Address}"</code></param>
+ /// <param name="messageFormat">Format string of the log message in message template format. Example: <c>"User {User} logged in from {Address}"</c></param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <returns>A disposable scope object. Can be null.</returns>
/// <example>
/// <param name="offset">The offset of the segment within the <paramref name="buffer"/>.</param>
/// <param name="length">The length of the segment.</param>
/// <exception cref="ArgumentNullException">
- /// <paramref name="buffer"/> is <code>null</code>.
+ /// <paramref name="buffer"/> is <c>null</c>.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="offset"/> or <paramref name="length"/> is less than zero, or <paramref name="offset"/> +
/// Indicates whether the current object is equal to another object of the same type.
/// </summary>
/// <param name="other">An object to compare with this object.</param>
- /// <returns><code>true</code> if the current object is equal to the other parameter; otherwise, <code>false</code>.</returns>
+ /// <returns><c>true</c> if the current object is equal to the other parameter; otherwise, <c>false</c>.</returns>
public bool Equals(StringSegment other) => Equals(other, StringComparison.Ordinal);
/// <summary>
/// </summary>
/// <param name="other">An object to compare with this object.</param>
/// <param name="comparisonType">One of the enumeration values that specifies the rules to use in the comparison.</param>
- /// <returns><code>true</code> if the current object is equal to the other parameter; otherwise, <code>false</code>.</returns>
+ /// <returns><c>true</c> if the current object is equal to the other parameter; otherwise, <c>false</c>.</returns>
public bool Equals(StringSegment other, StringComparison comparisonType)
{
if (Length != other.Length)
/// <param name="a">The first <see cref="StringSegment"/> to compare.</param>
/// <param name="b">The second <see cref="StringSegment"/> to compare.</param>
/// <param name="comparisonType">One of the enumeration values that specifies the rules for the comparison.</param>
- /// <returns><code>true</code> if the objects are equal; otherwise, <code>false</code>.</returns>
+ /// <returns><c>true</c> if the objects are equal; otherwise, <c>false</c>.</returns>
public static bool Equals(StringSegment a, StringSegment b, StringComparison comparisonType)
{
return a.Equals(b, comparisonType);
/// Checks if the specified <see cref="string"/> is equal to the current <see cref="StringSegment"/>.
/// </summary>
/// <param name="text">The <see cref="string"/> to compare with the current <see cref="StringSegment"/>.</param>
- /// <returns><code>true</code> if the specified <see cref="string"/> is equal to the current <see cref="StringSegment"/>; otherwise, <code>false</code>.</returns>
+ /// <returns><c>true</c> if the specified <see cref="string"/> is equal to the current <see cref="StringSegment"/>; otherwise, <c>false</c>.</returns>
public bool Equals(string text)
{
return Equals(text, StringComparison.Ordinal);
/// </summary>
/// <param name="text">The <see cref="string"/> to compare with the current <see cref="StringSegment"/>.</param>
/// <param name="comparisonType">One of the enumeration values that specifies the rules to use in the comparison.</param>
- /// <returns><code>true</code> if the specified <see cref="string"/> is equal to the current <see cref="StringSegment"/>; otherwise, <code>false</code>.</returns>
+ /// <returns><c>true</c> if the specified <see cref="string"/> is equal to the current <see cref="StringSegment"/>; otherwise, <c>false</c>.</returns>
/// <exception cref="ArgumentNullException">
- /// <paramref name="text"/> is <code>null</code>.
+ /// <paramref name="text"/> is <c>null</c>.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(string text, StringComparison comparisonType)
/// <summary>
/// Checks if two specified <see cref="StringSegment"/> have the same value.
/// </summary>
- /// <param name="left">The first <see cref="StringSegment"/> to compare, or <code>null</code>.</param>
- /// <param name="right">The second <see cref="StringSegment"/> to compare, or <code>null</code>.</param>
- /// <returns><code>true</code> if the value of <paramref name="left"/> is the same as the value of <paramref name="right"/>; otherwise, <code>false</code>.</returns>
+ /// <param name="left">The first <see cref="StringSegment"/> to compare, or <c>null</c>.</param>
+ /// <param name="right">The second <see cref="StringSegment"/> to compare, or <c>null</c>.</param>
+ /// <returns><c>true</c> if the value of <paramref name="left"/> is the same as the value of <paramref name="right"/>; otherwise, <c>false</c>.</returns>
public static bool operator ==(StringSegment left, StringSegment right) => left.Equals(right);
/// <summary>
/// Checks if two specified <see cref="StringSegment"/> have different values.
/// </summary>
- /// <param name="left">The first <see cref="StringSegment"/> to compare, or <code>null</code>.</param>
- /// <param name="right">The second <see cref="StringSegment"/> to compare, or <code>null</code>.</param>
- /// <returns><code>true</code> if the value of <paramref name="left"/> is different from the value of <paramref name="right"/>; otherwise, <code>false</code>.</returns>
+ /// <param name="left">The first <see cref="StringSegment"/> to compare, or <c>null</c>.</param>
+ /// <param name="right">The second <see cref="StringSegment"/> to compare, or <c>null</c>.</param>
+ /// <returns><c>true</c> if the value of <paramref name="left"/> is different from the value of <paramref name="right"/>; otherwise, <c>false</c>.</returns>
public static bool operator !=(StringSegment left, StringSegment right) => !left.Equals(right);
// PERF: Do NOT add a implicit converter from StringSegment to String. That would negate most of the perf safety.
/// </summary>
/// <param name="text">The <see cref="string"/>to compare.</param>
/// <param name="comparisonType">One of the enumeration values that specifies the rules to use in the comparison.</param>
- /// <returns><code>true</code> if <paramref name="text"/> matches the beginning of this <see cref="StringSegment"/>; otherwise, <code>false</code>.</returns>
+ /// <returns><c>true</c> if <paramref name="text"/> matches the beginning of this <see cref="StringSegment"/>; otherwise, <c>false</c>.</returns>
/// <exception cref="ArgumentNullException">
- /// <paramref name="text"/> is <code>null</code>.
+ /// <paramref name="text"/> is <c>null</c>.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool StartsWith(string text, StringComparison comparisonType)
/// </summary>
/// <param name="text">The <see cref="string"/>to compare.</param>
/// <param name="comparisonType">One of the enumeration values that specifies the rules to use in the comparison.</param>
- /// <returns><code>true</code> if <paramref name="text"/> matches the end of this <see cref="StringSegment"/>; otherwise, <code>false</code>.</returns>
+ /// <returns><c>true</c> if <paramref name="text"/> matches the end of this <see cref="StringSegment"/>; otherwise, <c>false</c>.</returns>
/// <exception cref="ArgumentNullException">
- /// <paramref name="text"/> is <code>null</code>.
+ /// <paramref name="text"/> is <c>null</c>.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool EndsWith(string text, StringComparison comparisonType)
/// <returns>The zero-based index position of the first occurrence in this instance where any character in <paramref name="anyOf"/>
/// was found; -1 if no character in <paramref name="anyOf"/> was found.</returns>
/// <exception cref="ArgumentNullException">
- /// <paramref name="anyOf"/> is <code>null</code>.
+ /// <paramref name="anyOf"/> is <c>null</c>.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="startIndex"/> or <paramref name="count"/> is less than zero, or <paramref name="startIndex"/> + <paramref name="count"/> is
}
/// <summary>
- /// Returns the <see cref="string"/> represented by this <see cref="StringSegment"/> or <code>String.Empty</code> if the <see cref="StringSegment"/> does not contain a value.
+ /// Returns the <see cref="string"/> represented by this <see cref="StringSegment"/> or <c>String.Empty</c> if the <see cref="StringSegment"/> does not contain a value.
/// </summary>
- /// <returns>The <see cref="string"/> represented by this <see cref="StringSegment"/> or <code>String.Empty</code> if the <see cref="StringSegment"/> does not contain a value.</returns>
+ /// <returns>The <see cref="string"/> represented by this <see cref="StringSegment"/> or <c>String.Empty</c> if the <see cref="StringSegment"/> does not contain a value.</returns>
public override string ToString()
{
return Value ?? string.Empty;