Exemplo n.º 1
0
        public async Task <bool> DeleteImage(int id)
        {
            var image = await context.Images.FindAsync(id);

            if (image == null)
            {
                return(false);
            }

            context.Images.Remove(image);
            await context.SaveChangesAsync();

            return(true);
        }
Exemplo n.º 2
0
        public async Task <bool> DeleteMerchant(int id)
        {
            var merchant = await context.Merchants.FindAsync(id);

            if (merchant == null)
            {
                return(false);
            }

            context.Merchants.Remove(merchant);
            await context.SaveChangesAsync();


            return(true);
        }
Exemplo n.º 3
0
        public async Task <bool> DeleteProduct(int id)
        {
            var product = await context.Products.FindAsync(id);

            if (product == null)
            {
                return(false);
            }

            context.Products.Remove(product);
            await context.SaveChangesAsync();


            return(true);
        }