Project Description:
ALinq Dynamic is a dynamic query solution for ALinq and Linq to SQL users, which supports Entity SQL and compatible with Entity Framework but do more.
Features
- Compatible with Entity Framework but do more.
- Linq and ESQL can work toghter.
- Supports ALinq and Linq to SQL framework.
- Run under .net 3.5 or higher version.
Examples
var employees = db.Employees.Where(o => o.Country == "EN");
var esql = "select e from @0 as e order by e.LastName";
var q = db.CreateQuery(esql, employees);
var esql = @"select o.OrderId, o.EmployeeId, d.ProductId, p.UnitPrice
from Orders as o
Inner Join OrderDetails as d on o.OrderId == d.OrderId
Inner Join Products as p on d.ProductId == p.ProductId";
var q2 = db.CreateQuery<IDataRecord>(esql);
var q3 = q2.Select(o => new { OrderId = (int)o["OrderID"],
EmployeeId = (int)o["EmployeeID"],
ProductId = (int)o["ProductId"] })
.Where(o => o.OrderId > 1000)
.Join(db.Employees, o => o.EmployeeId, e => e.EmployeeID,
(a, b) => new { a.EmployeeId,
a.OrderId,
a.ProductId,
b.City,
b.Address })
.Take(10);
q3.Execute();
