Monday, July 16, 2007
Added Lambda Functions to VB.NET 9.0 in June 2007 CTP
Starting from the June 2007 CTP release even Visual Basic language has its own way to manage Lambda expressions. Let's see an example:
1: Public Delegate Function Sum(ByVal a As Integer, ByVal b As Integer) As Integer
2: ...
3: Dim DoSum As Sum = Function(ByVal a, ByVal b) a + b
4: Dim ret As Integer = DoSum(4, 5)
5:
6: 'Using named arguments
7: ret = DoSum(b:=3, a:=4)
Using the Function keyword you can define the Lambda expression (see row 3). In the next beta 2 release will not be more needed to specify the ByVal keyword for the Lambda's parameters.
Thanks to Corrado Cavalli for this info.
1: Public Delegate Function Sum(ByVal a As Integer, ByVal b As Integer) As Integer
2: ...
3: Dim DoSum As Sum = Function(ByVal a, ByVal b) a + b
4: Dim ret As Integer = DoSum(4, 5)
5:
6: 'Using named arguments
7: ret = DoSum(b:=3, a:=4)
Using the Function keyword you can define the Lambda expression (see row 3). In the next beta 2 release will not be more needed to specify the ByVal keyword for the Lambda's parameters.
Thanks to Corrado Cavalli for this info.
Labels: June 2007 CTP, LINQ, VB
Thursday, June 28, 2007
SQLMetal and Linq to SQL designer will use the same DBML schema from Beta 2
As declared by Jay Hickerson from Microsoft, starting with Beta 2 the code generated by SQLMetal tool and Linq to SQL designer will be the same since they share the same DBML schema.
Labels: C#, LINQ, Orcas Beta 2, VB
Friday, June 08, 2007
Contains() method in Beta 2
New info from official LINQ forum. This time is the Contains() method the main actor. It will be released a new Contains() prototype in LINQ to SQL framework that accepts an object array. This will be translated in the SELECT ... IN ... statement allowing us to select just the value included in the array.
Labels: C#, LINQ, Orcas Beta 2, VB
Wednesday, June 06, 2007
CommandTimeout property will be added to DataContext class
Reading the official forum and this thread, Matt said that the CommandTimeout property will be added in the next release of LINQ to SQL.
Labels: C#, LINQ, Orcas Beta 2, VB
Saturday, June 02, 2007
New events added in Beta 2
LINQ's Beta 2 will add some new events support. When you use SubmitChanges() the Validate event will be raised. Catching this event you will be able to validate your data before they will be inserted into the database.
You also be able to implement:
OnLoaded() -- called after loaded by DataContext
OnCreated() -- called any time an entity is constructed
Thanks to Matt Warren for the info.
You also be able to implement:
OnLoaded() -- called after loaded by DataContext
OnCreated() -- called any time an entity is constructed
Thanks to Matt Warren for the info.
Labels: C#, LINQ, Orcas Beta 2, VB
DataShape class will be renamed in beta 2
As stated by Matt Warren in this thread of the official LINQ forum the DataShape class will be renamed into DataLoadOptions and its property Shape will become LoadOptions.
That's the reason: "We had too many people thinking that the 'shape' was being enforced throughout the lifetime of the DataContext when it only realy controls the initial loading of the data. I still like 'Shape' better, but c'est la vie."
That's the reason: "We had too many people thinking that the 'shape' was being enforced throughout the lifetime of the DataContext when it only realy controls the initial loading of the data. I still like 'Shape' better, but c'est la vie."
Labels: C#, LINQ, Orcas Beta 2, VB
Saturday, May 12, 2007
LINQ for Visual Basic 2005 will be complete only in Beta 2
As declared by Amanda Silver (Lead Program Manager of Visual Basic team) in a couple of threads in the official forum, LINQ will be fully supported in VB only from the Orcas beta 2. Read more here and here.
Monday, April 23, 2007
LINQ's VB samples for "Orcas" beta 1
I wasn't still able to check them but Visual Basic team had released updated samples for LINQ contained in "Orcas" beta 1 release. You can download samples here.
