How to pull back all parent/child data in complex object

Viewed 17093

I have these two tables with a one (category) to many (product) relationship in the database:

Table Product
    Name
    Description
    ProductCategory

Table Category
    Category
    Description

And these classes:

public class Product
{
    public string Name { get; set; }
    public string Description { get; set; }
    public Category CategoryName { get; set; }    
}

public class Category
{
    public string CategoryName { get; set; }
    public string Description { get; set; }    
}

I want to get a list back with all product and category object data in a list.

I've read about multipleResults and queryMultiple but can't see how to tie the two together.

I know how to do it for a single product but what about all products with their individual category objects as well.

2 Answers
Related