C#
C# is a coding language. Used for code in Unity and many other people.
Watch Brackeys
C#
C# is a coding language. Used for code in Unity and many other people.
Watch Brackeys
c#
/* Answer to: "c#" */
/*
C# is a general-purpose, multi-paradigm programming language
encompassing strong typing, lexically scoped, imperative,
declarative, functional, generic, object-oriented, and
component-oriented programming disciplines.
*/
C#
npm run build
c#
if your looking for C# or C++ compiler IDE I would suggest visual studio 2019.
c#
/* A C# (C-sharp ex.) */
using System;
namespace helloWorld
{
class Program
{
static void Main()
{
Console.WriteLine("What's your age?")
string age = Console.ReadLine()
Console.WriteLine($"You are {age} years old!")
}
}
}
C#
[ApiVersion("1.0")]
[Route("api/[controller]")]
[ApiController]
public class ProductsController : ControllerBase
{
private readonly IProductService _productService;
public ProductsController(IProductService productService)
{
_productService = productService;
}
[HttpGet]
public IActionResult GetProducts()
{
return Ok(_productService.GetProducts());
}
}
C#
var array = new string[] {"You", "say", "goodbye", "I", "say", "hello"};
Console.WriteLine(array[^1]); // Writes `hello` because it is the first element from the end.
C#
public class CorrelationIdHandler : DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken)
{
// See if there's a CorrelationId on the request header
// I actually store the header name in a const string, but for brevity it's a magic string here
var correlationId = request.Headers.Get("x-correlation-id");
// If the correlationId is not set on the header, generate a new GUID and use that instead.
if (string.IsNullOrWhatespace(correlationId))
correlationId = Guid.NewGuid().ToString();
// You can do var accessor = new CorrelationIdAccessor();
// but since I've got Dependency Injection setup I can grab it from IDependencyScope
var scope = request.GetDependencyScope();
var accessor = scope.GetService<CorrelationIdAccessor>();
accessor.CorrelationId = correlationId;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us