Exemplo n.º 1
0
        public async Task <bool> DeleteCategoryAsync(Guid id)
        {
            var categoryToDelete = await this.GetCategoryAsync(id);

            if (categoryToDelete == null)
            {
                return(false); // Could not find specified category
            }

            _context.Remove(categoryToDelete);

            return(await SaveAsync());
        }
Exemplo n.º 2
0
        public async Task DeleteImage(Guid id)
        {
            var foundImage = await GetSavedImage(id);

            if (foundImage == null)
            {
                return;
            }

            _context.Remove(foundImage);

            await this.SaveAsync();
        }