Subsonic 3 - SimpleRepository

前端 未结 1 607
失恋的感觉
失恋的感觉 2020-12-09 22:16

I am playing around with Subsonic 3\'s simple repository and am hitting walls in understanding how to deal with foreign keys...

If I have a product object containing

相关标签:
1条回答
  • 2020-12-09 23:14

    you need to get linq to populate it,
    using something like
    var query = from product in repo.All(Product)
    join categoryItem in repo.All(Category)
    on product.CategoryId equals categoryItem.Id
    select new {
    ID = product.ID,
    name = product.name,
    description = product.description,
    categoryId= product.CategoryId
    category = categoryItem
    };

    0 讨论(0)
提交回复
热议问题