From 69f41a89342d78b33679dd22596cad660b7ff9c0 Mon Sep 17 00:00:00 2001 From: Olabamiji Oyetubo <60369677+bigboybamo@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:36:22 +0100 Subject: [PATCH 1/2] Update access-modifiers.md Added description for file access type modifier --- .../programming-guide/classes-and-structs/access-modifiers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/csharp/programming-guide/classes-and-structs/access-modifiers.md b/docs/csharp/programming-guide/classes-and-structs/access-modifiers.md index 5543714e1a752..2fc42d93fb2ac 100644 --- a/docs/csharp/programming-guide/classes-and-structs/access-modifiers.md +++ b/docs/csharp/programming-guide/classes-and-structs/access-modifiers.md @@ -73,6 +73,8 @@ To set the access level for a `class` or `struct` member, add the appropriate ke Finalizers can't have accessibility modifiers. Members of an `enum` type are always `public`, and no access modifiers can be applied. +The `file` access modifier is allowed only on top-level (non-nested) type declarations. + ## C# language specification [!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)] From cdfca2318e1408936283d56bbddc4aba048c4518 Mon Sep 17 00:00:00 2001 From: Olabamiji Oyetubo <60369677+bigboybamo@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:18:55 +0100 Subject: [PATCH 2/2] Update snippet8003.fs --- samples/snippets/fsharp/lang-ref-2/snippet8003.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/snippets/fsharp/lang-ref-2/snippet8003.fs b/samples/snippets/fsharp/lang-ref-2/snippet8003.fs index 413f87b2a126c..bbeb2732ae1e8 100644 --- a/samples/snippets/fsharp/lang-ref-2/snippet8003.fs +++ b/samples/snippets/fsharp/lang-ref-2/snippet8003.fs @@ -1,5 +1,6 @@ open System.Net open Microsoft.FSharp.Control.WebExtensions +open System.Net.Http let urlList = [ "Microsoft.com", "http://www.microsoft.com/" "MSDN", "http://msdn.microsoft.com/" @@ -10,8 +11,8 @@ let fetchAsync(name, url:string) = async { try let uri = new System.Uri(url) - let webClient = new WebClient() - let! html = webClient.AsyncDownloadString(uri) + let httpClient = new HttpClient() + let! html = httpClient.GetStringAsync(uri) |> Async.AwaitTask printfn "Read %d characters for %s" html.Length name with | ex -> printfn "%s" (ex.Message); @@ -24,4 +25,4 @@ let runAll() = |> Async.RunSynchronously |> ignore -runAll() \ No newline at end of file +runAll()