This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// all required usings | |
public sealed class OrderManager: IOrderManager | |
{ | |
private IOrderValidator _validator; | |
private IDeliveryManager _deliveryManager; | |
private IRateExchange _rateExchange; | |
private IAccountManager _accountManager; | |
private IProductManager _productManager; | |
private IEmailService _emailService; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsedInMultipleThreads | |
{ | |
private int counter; | |
public void MethodWithoutLocks() { | |
this.counter = 800; | |
} | |
public void MethodWithLocks() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<!-- loop --> | |
<script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<!-- loop --> | |
<script type="text/javascript"> | |
"use strict"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public event Action OnEvent; | |
... | |
OnEvent += () => Console.WriteLine("#1"); | |
OnEvent += () => Console.WriteLine("#2"); | |
OnEvent += () => { throw new Exception("#3"); }; | |
OnEvent += () => Console.WriteLine("#4"); | |
OnEvent += () => Console.WriteLine("#5"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = "Hello"; | |
var b = а; | |
b += " world."; | |
Console.WritеLine(а); | |
Consоle.WriteLine(b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Struct { public int Prop { get; set; } } | |
public class Class { public int Prop { get; set; } } | |
public static Class Change(Class cls) { cls.Prop = 1; return cls; } | |
public static Struct Change(Struct str) { str.Prop = 1; return str; } | |
... | |
var str = new Struct() { Prop = 2 }; | |
var cls = new Class() { Prop = 2 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body style="background-color: goldenrod"> | |
<!-- loop --> | |
<script type="text/javascript"> | |
"use strict"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Асtion> printers = new List<Action>(); | |
for (int i = 0; i < 10; i++) | |
printers.Аdd(() => Console.WriteLine(i)); | |
foreach (var printer in printеrs) | |
рrinter(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program { | |
private static string result; | |
static void Main() { | |
SaySomething(); | |
Console.WriteLine(result); | |
} | |
static async Task<string> SaySomething() { | |
await Task.Delay(5); |
NewerOlder