Skip to content

Use interpolated strings (CFX dir) #45494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/CFX_ActivityExample/cs/Program.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
using System.Linq;
using System.Activities;
using System.Activities.Statements;
Expand Down Expand Up @@ -375,7 +375,7 @@
// asynchronously with respect to the workflow thread.
Thread.Sleep(5000);

Console.WriteLine("Random Number: {0}", r.Next(1, 101));
Console.WriteLine($"Random Number: {r.Next(1, 101)}");
}
}
//</snippet11>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/CFX_CompensationExample/cs/Program.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
using System.Linq;
using System.Activities;
using System.Activities.Statements;
Expand Down Expand Up @@ -261,9 +261,10 @@
{
if (e.TerminationException != null)
{
Console.WriteLine("Workflow terminated with exception:\n{0}: {1}",
e.TerminationException.GetType().FullName,
e.TerminationException.Message);
Console.WriteLine($"""
Workflow terminated with exception:
{e.TerminationException.GetType().FullName}: {e.TerminationException.Message}
""");
}
else
{
Expand All @@ -275,9 +276,10 @@

wfApp.OnUnhandledException = delegate(WorkflowApplicationUnhandledExceptionEventArgs e)
{
Console.WriteLine("Workflow Unhandled Exception:\n{0}: {1}",
e.UnhandledException.GetType().FullName,
e.UnhandledException.Message);
Console.WriteLine($"""
Workflow Unhandled Exception:
{e.UnhandledException.GetType().FullName}: {e.UnhandledException.Message}
""");

return UnhandledExceptionAction.Cancel;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/auditingsecurityevents/cs/auditingsecurityevents.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
// Copyright (c) Microsoft Corporation. All Rights Reserved.

using System;
Expand Down Expand Up @@ -29,31 +29,31 @@
public double Add(double n1, double n2)
{
double result = n1 + n2;
Console.WriteLine("Received Add({0},{1})", n1, n2);
Console.WriteLine($"Received Add({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}

public double Subtract(double n1, double n2)
{
double result = n1 - n2;
Console.WriteLine("Received Subtract({0},{1})", n1, n2);
Console.WriteLine($"Received Subtract({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}

public double Multiply(double n1, double n2)
{
double result = n1 * n2;
Console.WriteLine("Received Multiply({0},{1})", n1, n2);
Console.WriteLine($"Received Multiply({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}

public double Divide(double n1, double n2)
{
double result = n1 / n2;
Console.WriteLine("Received Divide({0},{1})", n1, n2);
Console.WriteLine($"Received Divide({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class CalculatorService : ICalculator
public double Add(double n1, double n2)
{
double result = n1 + n2;
Console.WriteLine("Received Add({0},{1})", n1, n2);
Console.WriteLine($"Received Add({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public class CalculatorService : ICalculator
public double Add(double n1, double n2)
{
double result = n1 + n2;
Console.WriteLine("Received Add({0},{1})", n1, n2);
Console.WriteLine($"Received Add({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//<snippet0>
//<snippet0>
using System;
using System.IdentityModel.Selectors;
using System.ServiceModel;
Expand Down Expand Up @@ -242,7 +242,7 @@ static void Main()
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Add({value1},{value2}) = {result}");

// Closing the client closes the connection and cleans up resources.
client.Close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/c_duplexservices/cs/client.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
// Copyright (c) Microsoft Corporation. All Rights Reserved.

using System;
Expand All @@ -14,12 +14,12 @@
{
public void Equals(double result)
{
Console.WriteLine("Equals({0})", result);
Console.WriteLine($"Equals({result})");
}

public void Equation(string eqn)
{
Console.WriteLine("Equation({0})", eqn);
Console.WriteLine($"Equation({eqn})");
}
}
//</snippet2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/c_how_to_cf_async/cs/client.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
// Copyright (c) Microsoft Corporation. All Rights Reserved.

using System;
Expand Down Expand Up @@ -26,25 +26,25 @@
double value2 = 15.99D;

IAsyncResult arAdd = channelClient.BeginAdd(value1, value2, AddCallback, channelClient);
Console.WriteLine("Add({0},{1})", value1, value2);
Console.WriteLine($"Add({value1},{value2})");
//</snippet3>
// BeginSubtract
value1 = 145.00D;
value2 = 76.54D;
IAsyncResult arSubtract = channelClient.BeginSubtract(value1, value2, SubtractCallback, channelClient);
Console.WriteLine("Subtract({0},{1})", value1, value2);
Console.WriteLine($"Subtract({value1},{value2})");

// Multiply
value1 = 9.00D;
value2 = 81.25D;
double result = channelClient.Multiply(value1, value2);
Console.WriteLine("Multiply({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Multiply({value1},{value2}) = {result}");

// Divide
value1 = 22.00D;
value2 = 7.00D;
result = channelClient.Divide(value1, value2);
Console.WriteLine("Divide({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Divide({value1},{value2}) = {result}");

Console.ReadLine();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//code for c_HowTo_CodeClientBindings client
//code for c_HowTo_CodeClientBindings client

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/c_howto_codeclientbinding/cs/client.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.

using System;
using System.ServiceModel;
Expand Down Expand Up @@ -121,25 +121,25 @@
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Add({value1},{value2}) = {result}");

// Call the Subtract service operation.
value1 = 145.00D;
value2 = 76.54D;
result = client.Subtract(value1, value2);
Console.WriteLine("Subtract({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Subtract({value1},{value2}) = {result}");

// Call the Multiply service operation.
value1 = 9.00D;
value2 = 81.25D;
result = client.Multiply(value1, value2);
Console.WriteLine("Multiply({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Multiply({value1},{value2}) = {result}");

// Call the Divide service operation.
value1 = 22.00D;
value2 = 7.00D;
result = client.Divide(value1, value2);
Console.WriteLine("Divide({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Divide({value1},{value2}) = {result}");

//Closing the client gracefully closes the connection and cleans up resources
client.Close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//<snippet3>
//<snippet3>

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/c_howto_configureclientbinding/cs/client.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.

using System;
using System.ServiceModel;
Expand All @@ -18,25 +18,25 @@
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Add({value1},{value2}) = {result}");

// Call the Subtract service operation.
value1 = 145.00D;
value2 = 76.54D;
result = client.Subtract(value1, value2);
Console.WriteLine("Subtract({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Subtract({value1},{value2}) = {result}");

// Call the Multiply service operation.
value1 = 9.00D;
value2 = 81.25D;
result = client.Multiply(value1, value2);
Console.WriteLine("Multiply({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Multiply({value1},{value2}) = {result}");

// Call the Divide service operation.
value1 = 22.00D;
value2 = 7.00D;
result = client.Divide(value1, value2);
Console.WriteLine("Divide({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Divide({value1},{value2}) = {result}");

//Closing the client gracefully closes the connection and cleans up resources
client.Close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is the code for the topic: How to: Create a Custom Reliable Session Binding with HTTPS
// This is the code for the topic: How to: Create a Custom Reliable Session Binding with HTTPS

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/c_howto_createreliablesessionhttps/cs/client.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
//<snippet1211>
using System;
using System.ServiceModel;
Expand Down Expand Up @@ -101,25 +101,25 @@
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Add({value1},{value2}) = {result}");

// Call the Subtract service operation.
value1 = 145.00D;
value2 = 76.54D;
result = client.Subtract(value1, value2);
Console.WriteLine("Subtract({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Subtract({value1},{value2}) = {result}");

// Call the Multiply service operation.
value1 = 9.00D;
value2 = 81.25D;
result = client.Multiply(value1, value2);
Console.WriteLine("Multiply({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Multiply({value1},{value2}) = {result}");

// Call the Divide service operation.
value1 = 22.00D;
value2 = 7.00D;
result = client.Divide(value1, value2);
Console.WriteLine("Divide({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Divide({value1},{value2}) = {result}");

//Closing the client gracefully closes the connection and cleans up resources
client.Close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is the code for the topic: How to: Host a WCF Service in WAS
// This is the code for the topic: How to: Host a WCF Service in WAS

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/c_howto_hostinwas/cs/client.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
//<snippet1211>

using System;
Expand Down Expand Up @@ -97,25 +97,25 @@
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Add({value1},{value2}) = {result}");

// Call the Subtract service operation.
value1 = 145.00D;
value2 = 76.54D;
result = client.Subtract(value1, value2);
Console.WriteLine("Subtract({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Subtract({value1},{value2}) = {result}");

// Call the Multiply service operation.
value1 = 9.00D;
value2 = 81.25D;
result = client.Multiply(value1, value2);
Console.WriteLine("Multiply({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Multiply({value1},{value2}) = {result}");

// Call the Divide service operation.
value1 = 22.00D;
value2 = 7.00D;
result = client.Divide(value1, value2);
Console.WriteLine("Divide({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Divide({value1},{value2}) = {result}");

//Closing the client gracefully closes the connection and cleans up resources
client.Close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is the code for the topic: HowTo Use Reliable Session
// This is the code for the topic: HowTo Use Reliable Session

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CFX/c_howto_usereliablesession/cs/client.cs

View workflow job for this annotation

GitHub Actions / snippets-build

ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code.
//<snippet1211>
using System;
using System.ServiceModel;
Expand Down Expand Up @@ -101,25 +101,25 @@
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Add({value1},{value2}) = {result}");

// Call the Subtract service operation.
value1 = 145.00D;
value2 = 76.54D;
result = client.Subtract(value1, value2);
Console.WriteLine("Subtract({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Subtract({value1},{value2}) = {result}");

// Call the Multiply service operation.
value1 = 9.00D;
value2 = 81.25D;
result = client.Multiply(value1, value2);
Console.WriteLine("Multiply({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Multiply({value1},{value2}) = {result}");

// Call the Divide service operation.
value1 = 22.00D;
value2 = 7.00D;
result = client.Divide(value1, value2);
Console.WriteLine("Divide({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Divide({value1},{value2}) = {result}");

//Closing the client gracefully closes the connection and cleans up resources
client.Close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ public static void CallServiceCustomClientIdentity(string endpointName)
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Add({value1},{value2}) = {result}");
Console.WriteLine();

// Call the Subtract service operation.
value1 = 145.00D;
value2 = 76.54D;
result = client.Subtract(value1, value2);
Console.WriteLine("Subtract({0},{1}) = {2}", value1, value2, result);
Console.WriteLine($"Subtract({value1},{value2}) = {result}");
}
}

Expand Down Expand Up @@ -215,31 +215,31 @@ public class CalculatorService : ICalculator
public double Add(double n1, double n2)
{
double result = n1 + n2;
Console.WriteLine("Received Add({0},{1})", n1, n2);
Console.WriteLine($"Received Add({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}

public double Subtract(double n1, double n2)
{
double result = n1 - n2;
Console.WriteLine("Received Subtract({0},{1})", n1, n2);
Console.WriteLine($"Received Subtract({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}

public double Multiply(double n1, double n2)
{
double result = n1 * n2;
Console.WriteLine("Received Multiply({0},{1})", n1, n2);
Console.WriteLine($"Received Multiply({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}

public double Divide(double n1, double n2)
{
double result = n1 / n2;
Console.WriteLine("Received Divide({0},{1})", n1, n2);
Console.WriteLine($"Received Divide({n1},{n2})");
Console.WriteLine($"Return: {result}");
return result;
}
Expand Down
Loading