sdk/dotnet/src/Microsoft.Datasync.Client/Utils/Arguments.cs
/// <summary>
/// Returns if the provided table name is valid.
/// </summary>
/// <param name="tableName">The name of the table to validate.</param>
/// <param name="allowSystemTables">If <c>true</c>, allow system tables.</param>
/// <param name="paramName">The parameter name.</param>
/// <exception cref="ArgumentNullException">if the table name is null.</exception>
/// <exception cref="ArgumentException">if the table name is invalid.</exception>
Returns if the provided table name is valid.
Returns if the provided table name is valid .
public static void IsValidTableName(string tableName, bool allowSystemTables, string paramName)
        {
            IsNotNull(tableName, paramName);
            if (allowSystemTables && tableName.StartsWith(SystemTables.Prefix))
            {
                tableName = tableName.Substring(SystemTables.Prefix.Length);
            }
            if (!validTableNameRegex.IsMatch(tableName))
            {
                throw new ArgumentException($"'{tableName}' is an invalid table name", paramName);
            }
        }
public static void IsValidTableName ( string tableName , bool allowSystemTables , string paramName ) { IsNotNull ( tableName , paramName ) ; if ( allowSystemTables && tableName . StartsWith ( SystemTables . Prefix ) ) { tableName = tableName . Substring ( SystemTables . Prefix . Length ) ; } if ( ! validTableNameRegex . IsMatch ( tableName ) ) { throw new ArgumentException ( $" ' { tableName } ' is an invalid table name " , paramName ) ; } }
Returns if the provided table name is valid.
Returns if the provided table name is valid .
// Skip the prefix - the rest of the system tables must still be valid
if the table name is null.
if the table name is null .
if the table name is invalid.
if the table name is invalid .
tableName
string
The name of the table to validate.
The name of the table to validate .
allowSystemTables
bool
None
paramName
string
The parameter name.
The parameter name .