public async Task SetupAsync(string location, ICryptoStorage cryptoStorage, byte[] key)
        {
            location.ThrowIfNullOrEmpty(nameof(location));
            cryptoStorage.ThrowIfNull(nameof(cryptoStorage));
            key.ThrowIfNull(nameof(key));

            Close();
            try
            {
                CurrentDatabase = databaseProvider.GetDatabase(location);
                await CurrentDatabase.SetupAsync(cryptoStorage, key).ConfigureAwait(false);
            }
            catch
            {
                CurrentDatabase = null;
                throw;
            }
        }
Beispiel #2
0
 internal static void Serialize(Stream destination, ICryptoStorage obj)
 {
     destination.ThrowIfNull(nameof(destination));
     obj.ThrowIfNull(nameof(obj));
     GenericSerializer.Serialize(destination, obj, TypeToEnumMappings, FormatExceptionMessage);
 }