Alex Rivera | Logout

LINQ in win32 DELPHI

Asked 2009-01-03T23:55:18.983
11

Is it possible to use LINQ in win32 DELPHI applications

Edit
Report

1 Answer

3

Yes and No. LINQ can really be thought of as two different items.

The first is the SQL like query syntax. It's what allows you to write the following in C#.

var query = from it in "foobar" select Char.ToUpper(it);

For delphi to use this version of LINQ, it would need to add explicit syntax support. AFAIK this does not exist.

Under the hood though, all LINQ queries are translated into a set of query expressions. These typically involve a heavy use of lambda expressions and closures. The above code is equivalent to the following non-SQL syntax version.

var query = "foobar".Select(x => Char.ToUpper(x));

I don't know the level of lambda or delegate support in Delphi but it should be possible to access LINQ in this method from Delphi.

answered 2009-01-04T00:03:44.490

Your Answer