Recursive LINQ query: select item and all children with subchildren

In this article we will learn select item and all children with sub children

Create Database:

Create a simple database named “SalesDB” using SQL Management studio. Now Create table named CmnItemGroup”.

SQL Script for Table

Some Data:

Let’s Start

Create a Virtual Model Class Named “vmGroup”

Create ItemGroupController or Class

Output

1

Hope this will Help :)

 

Leave a Reply

Your email address will not be published. Required fields are marked *