c# - asp.net MVC how to show chlid count of model -
that's pretty simple linq query:
var productchildcounts = context.productgroups .include(pg => pg.products) .include(pg => pg.attributes) .select(pg => new { pg.title, productcount = pg.products.count(), attributecount = pg.attributes.count() });
Comments
Post a Comment