LINQ - Language Integrated Query
from item in Metadatas
- Feature Introduced in Visual Studio 2008
- Supported from Visual Studio 2008 & later versions of visual Studio.
- Used or Query the result set from Objects/XML/ADO.Net (Object collection/Data Set /SQL Server/Entities/XML).
- Using Linq
For Querying result in our front end C# language support LINQ.
Sample Query for Linq
var q=(from item in TAA_Parcels
where item.IsDeleted==false
select new{
item.ParcelID,
item.ParcelNumber,
}).ToList();
q.Dump();
Result Set
INNER JOIN uisng LINQ Query
from item in Metadatas
join item1 in BusinessRules on item.DatabaseID equals item1.DatabaseID
where item.DatabaseID == 1 orderby item.ReportTypeID
select new
{
item.MetadataID,
item1.RuleName,
item.ReportTypeID,
item1.FormulaExpression
}
where item.DatabaseID == 1 orderby item.ReportTypeID
select new
{
item.MetadataID,
item1.RuleName,
item.ReportTypeID,
item1.FormulaExpression
}
CROSS JOIN using LINQ
No comments :
Post a Comment