sdk/dotnet/src/Microsoft.Datasync.Client/Offline/SyncContext.cs
/// <summary>
/// Obtains a query ID from a query and table name.  This is used
/// when the dev doesn't specify a query ID.
/// </summary>
/// <param name="tableName">The name of the table.</param>
/// <param name="query">The query string.</param>
/// <returns>A query ID.</returns>
Obtains a query ID from a query and table name.  This is used
when the dev doesn't specify a query ID.
Obtains a query ID from a query and table name . This is used when the dev doesn ' t specify a query ID .
internal static string GetQueryIdFromQuery(string tableName, string query)
        {
            string hashKey = $"q|{tableName}|{query}";
            byte[] bytes = Encoding.UTF8.GetBytes(hashKey);
            using MD5 md5 = MD5.Create();
            byte[] hashBytes = md5.ComputeHash(bytes);
            return BitConverter.ToString(hashBytes).Replace("-", string.Empty).ToLower();
        }
internal static string GetQueryIdFromQuery ( string tableName , string query ) { string hashKey = $" q| { tableName } | { query } " ; byte [ ] bytes = Encoding . UTF8 . GetBytes ( hashKey ) ; using MD5 md5 = MD5 . Create ( ) ; byte [ ] hashBytes = md5 . ComputeHash ( bytes ) ; return BitConverter . ToString ( hashBytes ) . Replace ( " " , string . Empty ) . ToLower ( ) ; }
Obtains a query ID from a query and table name.
Obtains a query ID from a query and table name .
A query ID.
A query ID .
tableName
string
The name of the table.
The name of the table .
query
string
The query string.
The query string .