public async Task <RemoveEmployerDto> GetConfirmDeleteEmployerOpportunityAsync(int opportunityId, string username) { var opportunityCount = _opportunityRepository.GetEmployerOpportunityCount(opportunityId); var employerCount = _opportunityRepository.GetManyAsync(o => o.OpportunityItem.Any(oi => oi.IsSaved && !oi.IsCompleted) && o.CreatedBy == username).ToList(); var removeEmployerDto = await _opportunityRepository.GetSingleOrDefaultAsync( op => op.Id == opportunityId, op => new RemoveEmployerDto { OpportunityCount = opportunityCount, EmployerName = op.Employer.CompanyName, EmployerCount = employerCount.Count }); return(removeEmployerDto); }