Technical Notes by Rogelio Prestol
ASP.NET, WebForms, Microsoft Ajax, C#, VB.NET, MSSQL
Friday, January 9, 2015
Inline Function in .NET
VB.NET
1 2 3 4 5
Dim
AddThis =
Function
(a
As
Integer
, b
As
Integer
)
As
Integer
Return
a + b
End
Function
Dim
c = AddThis(1, 1)
C#
1 2 3 4 5 6
Func
<
int
,
int
,
int
> AddThis =
delegate
(
int
a,
int
b)
{
return
a + b;
};
int
c = AddThis(1, 1);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment