I have a typical response
ResultModel
{
Bool Result,
Object Response
}
I want to send for example categories with products
var response = new List<Category>
{
new Category {Name = "1", Products = new List<Product> {new Product {Name = "1_1"}, new Product {Name = "1_2"}} },
new Category {Name = "2", Products = new List<Product> {new Product {Name = "2_1"}, new Product {Name = "2_2"}} },
new Category {Name = "3", Products = new List<Product> () },
}
And my response
return new ResultModel
{
Response = response,
Result = true
};
But I can't receive Products property in response. Anybody knows why? Thanks