public async Task <IpFilter> DeleteCategory(int id) { var category = await GetCategoryById(id); _dbContext.Remove(category); await _dbContext.SaveChangesAsync(); return(category); }
public async Task <UsersIp> DeleteCopyright(Guid userId, Guid id) { var copyright = await GetCopyrightById(userId, id); _dbContext.Remove(copyright); await _dbContext.SaveChangesAsync(); return(copyright); }
public async Task <FAQ> DeleteFAQ(Guid id) { var faq = await GetFAQById(id); _dbContext.Remove(faq); await _dbContext.SaveChangesAsync(); return(faq); }
public async Task <City> DeleteCity(int id) { var city = await GetCityById(id); _dbContext.Remove(city); await _dbContext.SaveChangesAsync(); return(city); }
public async Task <Claim> DeleteClaim(Guid id) { var claim = await GetClaimById(id); _dbContext.Remove(claim); await _dbContext.SaveChangesAsync(); return(claim); }
//delete account public async Task <User> DeleteMyAccount(Guid id) { var user = await GetUserById(id); _dbContext.Remove(user); await _dbContext.SaveChangesAsync(); return(user); }
//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); } }