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
<h2>@Config?.WelcomeMessage</h2> | |
@code { | |
protected ConfigObject? Config { get; set; } | |
protected int RenderCount { get; set; } | |
protected override async Task OnInitializedAsync() | |
{ |
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
function Name { | |
#what is the output here? | |
write-host $name # $name is "foo" because it is the global variable $name | |
$name = "bar" #the global $name cannot be modified here and so this is actually creating | |
# a local variable, same as $local:name = "bar". | |
# in other words it will create a local variable if you try to modify a variable in a child scope | |
# what is the output here? | |
write-host $name # so now $name is implied to be the $local one (because a $local:name exists) and not the $script one is "bar" | |
# powershell will get the local variable if it exists, otherwise it will get the script variable otherwise the global variable... | |
#what is the output here? |
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
namespace Foo { | |
public class Blah { | |
public IEnumerable<CustomerServiceReportItem> LoadCustomerServicesReportData(int year, int month) | |
{ | |
DateTimeOffset startDate = new DateTimeOffset(year, month, 1, 0, 0, 0, TimeSpan.Zero); | |
DateTimeOffset cutoffDate = new DateTimeOffset(1900, 1, 1, 0, 0, 0, TimeSpan.Zero); | |
var isPudUser = (_CurrentUser == null || _CurrentUser.IsPudUser); |
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
struct Nullable | |
{ | |
/// <summary> | |
/// Provides the value when HasValue returns true | |
/// </summary> | |
public object Value{ get; private set; } | |
/// <summary> | |
/// Indicates whether there is a value or whether | |
/// the value is "null" |
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
struct NullableInt | |
{ | |
/// <summary> | |
/// Provides the value when HasValue returns true | |
/// </summary> | |
public int Value{ get; private set; } | |
/// <summary> | |
/// Indicates whether there is a value or whether | |
/// the value is "null" |
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 CellStack | |
{ | |
public virtual Cell Pop(); | |
public virtual void Push(Cell cell); | |
// ... | |
} |
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.Collections; | |
class Program | |
{ | |
// ... | |
public void Sketch() | |
{ | |
Stack path = new Stack(); | |
Cell currentPosition; | |
ConsoleKeyInfo key; // Added in C# 2.0 |
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 Stack | |
{ | |
public virtual object Pop() { ... } | |
public virtual void Push(object obj) { ... } | |
// ... | |
} |
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
var x= 1; |