Data/CafeLib.Data.Sources/SqlCommandProvider.cs
/// <summary>
/// Check Sql key type for requiring quotation.
/// </summary>
/// <typeparam name="TKey">key type</typeparam>
/// <param name="id"></param>
/// <returns>return quoted id for certain types</returns>
Check Sql key type for requiring quotation.
Check Sql key type for requiring quotation .
private static string CheckSqlKey<TKey>(TKey id)
        {
            switch (id?.GetType().Name)
            {
                case "String":
                case "Guid":
                    return $"'{id}'";
                case null:
                    return @"NULL";
                default:
                    return $"{id}";
            }
        }
private static string CheckSqlKey < TKey > ( TKey id ) { switch ( id ? . GetType ( ) . Name ) { case " " : case " " : return $" ' { id } ' " ; case null : return @"NULL" ; default : return $" { id } " ; } }
Check Sql key type for requiring quotation.
Check Sql key type for requiring quotation .
return quoted id for certain types
return quoted id for certain types
id
TKey
None
typeparam
None