Core/CafeLib.Core/Support/ObjectId.cs
/// <summary>
/// Parses a string and creates a new ObjectId.
/// </summary>
/// <param name="s">The string value.</param>
/// <returns>A ObjectId.</returns>
Parses a string and creates a new ObjectId.
Parses a string and creates a new ObjectId .
public static ObjectId Parse(string s)
        {
            if (s == null)
            {
                throw new ArgumentNullException(nameof(s));
            }
            if (TryParse(s, out var objectId))
            {
                return objectId;
            }
            var message = $"'{s}' is not a valid 24 digit hex string.";
            throw new FormatException(message);
        }
public static ObjectId Parse ( string s ) { if ( s == null ) { throw new ArgumentNullException ( nameof ( s ) ) ; } if ( TryParse ( s , out var objectId ) ) { return objectId ; } var message = $" ' { s } ' is not a valid 24 digit hex string. " ; throw new FormatException ( message ) ; }
Parses a string and creates a new ObjectId.
Parses a string and creates a new ObjectId .
None
s
string
The string value.
The string value .