Skip to content

Commit 140b758

Browse files
Copilotgewarren
andcommitted
Update F# projects to net10.0 and use raw string literals in C#
Co-authored-by: gewarren <[email protected]>
1 parent 7823f7a commit 140b758

File tree

9 files changed

+12
-12
lines changed
  • snippets
    • csharp/System.Collections.Generic/DictionaryTKey,TValue
      • System.Collections.IDictionary.Contains
      • System.Collections.IDictionary.Item
      • System.Collections.IDictionary.Remove
    • fsharp/System.Collections.Generic/DictionaryTKey,TValue
      • System.Collections.IDictionary.Contains
      • System.Collections.IDictionary.GetEnumerator
      • System.Collections.IDictionary.Item
      • System.Collections.IDictionary.Keys
      • System.Collections.IDictionary.Remove
      • System.Collections.IDictionary.Values

9 files changed

+12
-12
lines changed

snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Contains/source.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void Main()
2525
if (!openWith.Contains("ht"))
2626
{
2727
openWith.Add("ht", "hypertrm.exe");
28-
Console.WriteLine($"Value added for key = \"ht\": {openWith["ht"]}");
28+
Console.WriteLine($"""Value added for key = "ht": {openWith["ht"]}""");
2929
}
3030

3131
// IDictionary.Contains returns false if the wrong data

snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Item/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public static void Main()
2222

2323
// The Item property is another name for the indexer, so you
2424
// can omit its name when accessing elements.
25-
Console.WriteLine($"For key = \"rtf\", value = {openWith["rtf"]}.");
25+
Console.WriteLine($"""For key = "rtf", value = {openWith["rtf"]}.""");
2626

2727
// The indexer can be used to change the value associated
2828
// with a key.
2929
openWith["rtf"] = "winword.exe";
30-
Console.WriteLine($"For key = \"rtf\", value = {openWith["rtf"]}.");
30+
Console.WriteLine($"""For key = "rtf", value = {openWith["rtf"]}.""");
3131

3232
// If a key does not exist, setting the indexer for that key
3333
// adds a new key/value pair.
@@ -54,6 +54,6 @@ public static void Main()
5454
// Unlike the default Item property on the Dictionary class
5555
// itself, IDictionary.Item does not throw an exception
5656
// if the requested key is not in the dictionary.
57-
Console.WriteLine($"For key = \"tif\", value = {openWith["tif"]}.");
57+
Console.WriteLine($"""For key = "tif", value = {openWith["tif"]}.""");
5858
}
5959
}

snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Remove/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public static void Main()
2222

2323
// Use the Remove method to remove a key/value pair. No
2424
// exception is thrown if the wrong data type is supplied.
25-
Console.WriteLine("\nRemove(\"dib\")");
25+
Console.WriteLine($"""{"\n"}Remove("dib")""");
2626
openWith.Remove("dib");
2727

2828
if (!openWith.Contains("dib"))
2929
{
30-
Console.WriteLine("Key \"dib\" is not found.");
30+
Console.WriteLine("""Key "dib" is not found.""");
3131
}
3232
}
3333
}

snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Contains/fs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.GetEnumerator/fs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Item/fs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Keys/fs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Remove/fs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Values/fs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

0 commit comments

Comments
 (0)