public async Task DeleteProduct(long id)
        {
            var product = GetProduct(id);

            if (product != null)
            {
                _dbContext.Remove <Product>(product);
                await _dbContext.SaveChangesAsync();
            }
        }
        public async Task DeleteAdvertisement(long id)
        {
            var advertisement = GetAdvertisement(id);

            if (advertisement != null)
            {
                _dbContext.Remove <Advertisement>(advertisement);
            }

            await _dbContext.SaveChangesAsync();
        }
Exemple #3
0
        public async Task DeleteManufacturer(long id)
        {
            var manufacturer = GetManufacturer(id);

            if (manufacturer != null)
            {
                _dbContext.Remove <Manufacturer>(manufacturer);
            }

            await _dbContext.SaveChangesAsync();
        }
Exemple #4
0
        public async Task DeleteUser(long id)
        {
            var user = GetUser(id);

            if (user != null)
            {
                _dbContext.Remove <User>(user);
            }

            await _dbContext.SaveChangesAsync();
        }