예제 #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());
        }
예제 #2
0
        public async Task DeleteImage(Guid id)
        {
            var foundImage = await GetSavedImage(id);

            if (foundImage == null)
            {
                return;
            }

            _context.Remove(foundImage);

            await this.SaveAsync();
        }