LINQ queries demonstrate how to operate and query the Magento objects wrapped in an Entity Framework data model. Below are some examples of LINQ queries supported by the Entity framework.
|
Select and Filter
Retrieve records from the Products table where the Product Name is "Vintage Backpack". |
|
||||
|
Contains
Retrieve records from the CustomerGroups table where the Code property contains the substring "Retailer". |
|
||||
|
Limit
Retrieve the first 10 records from the Products table. |
|
||||
|
Order by
Retrieve all records from the CustomerGroups table and sorts them in descending order based on the Code property. |
|
||||
|
Count
Count all entities that match a given criterion. |
|
||||
|
Group By
Group records from the Products table based on the Price property. The groups are then ordered in descending order based on the Price. |
|
||||
|
Joins
Cross join between the Products and CustomerGroups tables. |
|
||||