public async Task <bool> DeleteUserDepartmentAsync(Guid userId, Guid deptId) { using (var scope = _dbContextScopeFactory.Create()) { var deleteItem = await _userDepartmentRepository .FindAsync(f => f.DeptID == deptId && f.UserID == userId); _userDepartmentRepository.Delete(deleteItem); await scope.SaveChangesAsync(); return(true); } }