This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Dynamic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
public class Program | |
{ | |
static void Main(string[] args) |
This file contains 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 void M(string x) | |
{ | |
if (!(x == "a")) | |
{ | |
if (!(x == "b")) | |
{ | |
if (x == "c") | |
{ | |
Console.WriteLine("c value"); | |
} |
This file contains 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
.method public hidebysig | |
instance void M ( | |
string x | |
) cil managed | |
{ | |
// Method begins at RVA 0x2050 | |
// Code size 73 (0x49) | |
.maxstack 2 | |
IL_0000: ldarg.1 |
This file contains 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 void M(string x) | |
{ | |
switch(x) | |
{ | |
case "a": | |
Console.WriteLine("a value"); | |
break; | |
case "b": | |
Console.WriteLine("b value"); | |
break; |
This file contains 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 async Task DoSomeThingAsync() | |
{ | |
var time = Stopwatch.StartNew(); | |
//a database call which takes 5 seconds to run | |
//await Task.Delay(5000); | |
//await PerformCalculationsAsync(); | |
Task t1 = Task.Delay(5000); | |
Task t2 = PerformCalculationsAsync(); |
This file contains 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 class Program | |
{ | |
static void Main(string[] args) | |
{ | |
AwaitTest at = new AwaitTest(); | |
at.DoSomeThingAsync().GetAwaiter().GetResult(); | |
} | |
} |
This file contains 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 class AwaitTest | |
{ | |
public async Task DoSomeThingAsync() | |
{ | |
var time = Stopwatch.StartNew(); | |
//a database call which takes 5 seconds to run | |
await Task.Delay(5000); | |
await PerformCalculationsAsync(); | |
This file contains 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
import { Component, ViewChild } from '@angular/core'; | |
import { TodoListComponent } from './todolist.component'; | |
@Component({ | |
selector: 'app-todo', | |
template: ` | |
<div> | |
<input type="text" placeholder="add a todo item here" [(ngModel)]="todotext"/> | |
<input type="submit" (click)="addItem()" value="Add Todo" /> | |
</div> |
This file contains 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
import { Component, Input } from '@angular/core'; | |
@Component({ | |
selector: 'app-todo-list', | |
template: ` | |
<div> | |
<ul> | |
<li *ngFor="let item of todoList"> | |
<input type="checkbox" [checked]="item.done" [(ngModel)]="item.done"/> | |
<span [style.textDecoration] = "item.done ? 'line-through' : ''">{{ item.name }}</span> |
This file contains 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
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-todo', | |
template: ` | |
<div> | |
<input type="text" placeholder="add a todo item here" [(ngModel)]="todotext"/> | |
<input type="submit" (click)="addItem()" value="Add Todo" /> | |
</div> | |
` |
NewerOlder