News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
public List GetNonSecretUsers()
{
string[] secretUsers = {"@secretUser", "@admin", "@root"}; List allpeople = GetAllPeople();
... }

You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list. The resulting list must not contain duplicates. Which code segment should you use?

  1. var secretPeople = (from p in allPeople
    from u in secretUsers
    where p.UserId == u
    select p).Distinct();
    return allPeople.Except(secretPeople);
    
  2. return from p in allPeople
    from u in secretUsers
    where p.UserId != u
    select p;
    
  3. return (from p in allPeople
    from u in secretUsers
    where p.UserId != u
    select p).Distinct();
    
  4. List people = new List(
    from p in allPeople
    from u in secretUsers
    where p.UserId != u
    select p);
    return people.Distinct();
    
Answer: Answer is a
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;