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()); }
public async Task DeleteImage(Guid id) { var foundImage = await GetSavedImage(id); if (foundImage == null) { return; } _context.Remove(foundImage); await this.SaveAsync(); }