Before:
namespace CodeSamples
{
public interface IShippingCalculator
{
}
}
After:
namespace CodeSamples;
public interface IShippingCalculator
{
}
public record ResponseClass(long Id, string Name, string Description, int DefaultCapacity);
public record CreateRequestClass(string Name, string Description, int DefaultCapacity);
public record UpdateRequestClass(string Name, string Description, int DefaultCapacity);
global using System.Linq;
string longMessage =
"""
This is a long message.
It has serveral lines.
Some are indented
more than others.
Some should start at the first column.
Some has "quoted text" in them.
""";
int[] numbers = { 1, 2, 3 };
Console.WriteLine(numbers is [1, 2, 3]); // => True
Console.WriteLine(numbers is [1, 2, 4]); // => False
Console.WriteLine(numbers is [1, 2, 3, 4]); // => False
Console.WriteLine(numbers is [0 or 1, <= 2, >= 3]); // => True
namespace CodeSamples;
public interface IDistanceCalculator
{
Distance GetDistance();
}
public class Distance
{
}
public class DistanceCalculator : IDistanceCalculator
{
public Distance GetDistance()
{
return new Distance();
}
}
public class ExampleController(IDistanceCalculator service)
{
public void TestPrimaryController()
{
service.GetDistance();
}
}
int[] numbers = [1, 2, 3, 4, 5];
List<string> names = ["Binh", "Doan", "Cuong"];