Пример #1
0
 public async Task RemoveAsync(Authenticator authenticator, Category category)
 {
     await _authenticatorCategoryRepository.DeleteAsync(new AuthenticatorCategory
     {
         AuthenticatorSecret = authenticator.Secret, CategoryId = category.Id
     });
 }
Пример #2
0
        async Task IAsyncLifetime.DisposeAsync()
        {
            var authenticators = await AuthenticatorRepository.GetAllAsync();

            for (var i = 0; i < authenticators.Count; i++)
            {
                var authenticator = authenticators[i];
                await AuthenticatorRepository.DeleteAsync(authenticator);
            }

            var categories = await CategoryRepository.GetAllAsync();

            for (var i = 0; i < categories.Count; i++)
            {
                var category = categories[i];
                await CategoryRepository.DeleteAsync(category);
            }

            var authenticatorCategories = await AuthenticatorCategoryRepository.GetAllAsync();

            for (var i = 0; i < authenticatorCategories.Count; i++)
            {
                var authenticatorCategory = authenticatorCategories[i];
                await AuthenticatorCategoryRepository.DeleteAsync(authenticatorCategory);
            }

            var customIcons = await CustomIconRepository.GetAllAsync();

            for (var i = 0; i < customIcons.Count; i++)
            {
                var customIcon = customIcons[i];
                await CustomIconRepository.DeleteAsync(customIcon);
            }
        }