Every building
has multiple rooms
. I would like to return data from a building
that includes a room number from every room
owned by said building
via a class buildingView
, which looks like this right now (with some pseudocode):
public class buildingView
{
public int id { get; set; }
public string name { get; set; }
...
public *something* roomNumbers *something*
}
To that end, I have the following query:
buildingView building = db.buildings.Select(b => new buildingView
{
id = b.id,
name = b.name,
...
roomNumbers = *I have no idea*
})
.Where(b => b.id == id)
.SingleOrDefault();
Room numbers are all strings, if that's relevant.
My questions:
How can I get my list of room numbers?
How can I improve my question's title? I lack the vocabulary right now to do better.
Is there a another way entirely?
Thanks!
P.S. If you are going to downvote, please say why. Otherwise how will I know how to improve my questions?