Initialize New Anonymous Type on VB.NET

This code snippet will shows you an example on how to initialize a new anonymous type and define the properties while at it as a function parameter in Visual Basic .NET. The example used is based on Flurl library by tmenier, and URL builder for .NET check it out at the Project’s GitHub Page, it’s pretty neat. Dim url = "http://www.some-api.com".AppendPathSegment("endpoint").SetQueryParams(New With { Key .api_key = ConfigurationManager.AppSettings("SomeApiKey"), Key .max_results = 20, Key ....

July 31, 2014 · Sebastian