From 2369d1c9018c722494d304dedc8b480c44ffd237 Mon Sep 17 00:00:00 2001 From: Youssef1313 <31348972+Youssef1313@users.noreply.github.com> Date: Fri, 5 Jul 2019 21:35:17 +0200 Subject: [PATCH 1/2] Add visual basic snippet code --- xml/System.Net.Http/HttpClient.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index 744f80ad89e..c0de9dc8671 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -127,6 +127,7 @@ If this change is undesirable, you can configure your application to use the old ## Examples [!code-csharp[System.Net.Http.HttpClient#1](~/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclient/cs/source.cs#1)] + [!code-vb[System.Net.Http.HttpClient#1](~/samples/snippets/visualbasic/VS_Snippets_Misc/system.net.http.httpclient/vb/source.vb#1)] The preceding code example uses an `async Task Main()` entry point. That feature requires C# 7.1 or later. @@ -2244,4 +2245,4 @@ httpClient.Timeout = TimeSpan.FromMinutes(10); - \ No newline at end of file + From e52a634f3c1a88354968790fbd9e6b03ec998a1f Mon Sep 17 00:00:00 2001 From: Youssef1313 <31348972+Youssef1313@users.noreply.github.com> Date: Tue, 9 Jul 2019 09:49:51 +0200 Subject: [PATCH 2/2] Add missing vb.net sample. --- xml/System.Net.Http/HttpClient.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index c0de9dc8671..3f30c777971 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -166,8 +166,19 @@ public class GoodController : ApiController HttpClient = new HttpClient(); } } +``` -``` +```vb +Public Class GoodController + Inherits ApiController + ' OK + Private Shared ReadOnly HttpClient As HttpClient; + + Shared Sub New() + HttpClient = New HttpClient() + End sub +End Class +``` ]]>