VB:
'shorthand object constructors; assigned initial properties
dim p as New Person() With {.FirstName = "john", .LastName="smith"}
'add handler for events
AddHandler context.BeginRequest, AddressOf Applicaton_BeginRequest
C#:
//shorthand object constructors; assigned initial properties
Person p = new Person() with {FirstName = "john", LastName="smith"}
//add handler for events
context.BeginRequest += Application_BeginRequest;
Leave a comment