Exemple #1
0
        public async Task <IpFilter> DeleteCategory(int id)
        {
            var category = await GetCategoryById(id);

            _dbContext.Remove(category);
            await _dbContext.SaveChangesAsync();

            return(category);
        }
Exemple #2
0
        public async Task <UsersIp> DeleteCopyright(Guid userId, Guid id)
        {
            var copyright = await GetCopyrightById(userId, id);

            _dbContext.Remove(copyright);
            await _dbContext.SaveChangesAsync();

            return(copyright);
        }
Exemple #3
0
        public async Task <FAQ> DeleteFAQ(Guid id)
        {
            var faq = await GetFAQById(id);

            _dbContext.Remove(faq);
            await _dbContext.SaveChangesAsync();

            return(faq);
        }
Exemple #4
0
        public async Task <City> DeleteCity(int id)
        {
            var city = await GetCityById(id);

            _dbContext.Remove(city);
            await _dbContext.SaveChangesAsync();

            return(city);
        }
Exemple #5
0
        public async Task <Claim> DeleteClaim(Guid id)
        {
            var claim = await GetClaimById(id);

            _dbContext.Remove(claim);
            await _dbContext.SaveChangesAsync();

            return(claim);
        }
Exemple #6
0
        //delete account
        public async Task <User> DeleteMyAccount(Guid id)
        {
            var user = await GetUserById(id);

            _dbContext.Remove(user);
            await _dbContext.SaveChangesAsync();

            return(user);
        }
Exemple #7
0
        //Delete User account
        public async Task <User> DeleteUser(Guid id)
        {
            var user = await _dbContext.Users.Where(x => x.Id == id && x.IsActive).AsNoTracking().FirstOrDefaultAsync();

            if (user != null)
            {
                _dbContext.Remove(user);
                await _dbContext.SaveChangesAsync();

                return(user);
            }
            else
            {
                return(null);
            }
        }