I’m a newbie in Linq and C# and I’m going need some help. These following marks “____” need to be filled out with the right syntax word. The main problem is that I can’t find the last keyword between owner.OwnerID and dog.OwnerID.
From your point of view, do you think that I’m using right synax code instead of “____“?
List<Owner> ownerList;
List<Dog> dogList;
public class Dog
{
public string Name { get; set; }
public int Age { get; set; }
public int OwnerID { get; set; }
}
public class Owner
{
public string Name { get; set; }
public int OwnerID { get; set; }
}
var query2 = _____ owner in ownerList
_____ _____ dogList _____
owner._____ _________ dog._____ into x
select new { a = owner, b = x};
var query2 = from owner in ownerList
from dog in dogList where
owner.OwnerID _________ dog.OwnerID into x
select new { a = owner, b = x};
Actually the 2nd one doesn’t really make any sense, and won’t compile. But I can’t think of anything else than
==to put in the blank… It might be a mistake in the exercise