Access data with LINQ
AX.NET provides support for the new technology in .NET 3.5 called LINQ (Language
Integrated Query). LINQ enables easy and structured data access by enabling inline
data query to be written with C# code against a model of the data source.
The syntax for writing LINQ queries has many similarities with SQL statements, and
is therefore easy for new developers to adapt.
Using the AX.NET Assembly Generator that comes with AX.NET, a .NET assembly (dll)
containing the structure (tables, classes, enum) of any AX Application can automatically
be generated. AX.NET then uses the generated AOT in the AX.NET Assembly to provide
the data model for the LINQ statements.
It is therefore possible to use .NET LINQ to query any data in an AX Application
including custom tables and fields, because the AX.NET Assembly is
tailored to match any AX Application.
The support for LINQ in AX.NET is a native implementation,
because it transforms the LINQ statements to X++ select
statements and executes them through the Microsoft Dynamics AX Business Connector.
There is no direct communication with the Microsoft Dynamics AX database, so all Dynamics
AX Business Logic and security is enforced.
Futhermore AX.NET also supports insert, update and delete of
data in Microsoft Dynamics AX. All data retrieved using LINQ can
easily be modified and deleted in .NET and the changes can be saved in Microsoft Dynamics AX.
The following LINQ features are supported
Select, Join, Where, Order By, Group By, First, FirstOrDefault, Max, Min, Average, Sum, Count,
SelectForUpdate.
|