-5

In listProducts I have a field called "family". I want to GroupBy this field.

var products = from listProducts in repository.All() where (listProducts.Code == "48654") select listProducts;` 
2

1 Answer 1

0

Try this,

var products = from listProducts in repository.All() where listProducts.Code == "48654" group listProducts by listProducts.family into grp select grp; 

For more information visit LINQ Group By

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.