L
Luna
I have the following 2 database tables
Category
----------
Id
Name
Photo
----------
Id
CatId
Title
There's a relationship between
Category.Id = Photo.CatId
The class generated by dbml has the following properties
Class Category
{
int Id
string Name
System.Data.Linq.EntitySet<Photo> Photos
}
Class Photo
{
int Id
int CatId
string Title
Category category
}
I would like to know how to write a LINQ query that will return
3 categories with 10 photos in each
do I need to write a query to the categories and then a loop to get photos
for each category?
Im not sure how to populate EntitySet<Photo> Photos. Tried ToList but it
didn't work
Can this be done with a single query?
thx
Luna
Category
----------
Id
Name
Photo
----------
Id
CatId
Title
There's a relationship between
Category.Id = Photo.CatId
The class generated by dbml has the following properties
Class Category
{
int Id
string Name
System.Data.Linq.EntitySet<Photo> Photos
}
Class Photo
{
int Id
int CatId
string Title
Category category
}
I would like to know how to write a LINQ query that will return
3 categories with 10 photos in each
do I need to write a query to the categories and then a loop to get photos
for each category?
Im not sure how to populate EntitySet<Photo> Photos. Tried ToList but it
didn't work
Can this be done with a single query?
thx
Luna