Amazon.CognitoSync.SyncManager.Internal.SQLiteLocalStorage.DeleteCachedIdentity C# (CSharp) Метод

DeleteCachedIdentity() публичный Метод

Delete the cached identity id
public DeleteCachedIdentity ( string key ) : void
key string
Результат void
        public void DeleteCachedIdentity(string key)
        {
            string query = "delete from kvstore where key = @key ";
            try
            {
                connection = new SqliteConnection("URI=file:" + filePath);
                connection.Open();

                using (var command = connection.CreateCommand())
                {
                    command.CommandText = query;
                    BindData(command, key);
                    command.ExecuteNonQuery();
                }
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                    connection.Dispose();
                }
            }
        }

Usage Example

 public override void ClearIdentityCache()
 {
     base.ClearIdentityCache();
     using (var kvStore = new SQLiteLocalStorage())
     {
         kvStore.DeleteCachedIdentity(GetNamespacedKey(IDENTITY_ID_CACHE_KEY));
     }
 }