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 Animal(string name) { Name = name; } | |
public Animal(string name) => Name = name; |
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 string GetFavoriteFood() { return favoriteFood; } | |
public string GetFavoriteFood() => favoriteFood; |
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 doubles = ints.ConvertAll(i => (double)i); | |
var doubles = ints.Select(i => (double)i).ToList(); |
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 i = 1; | |
Print(i); | |
Console.WriteLine(i); | |
void Print(in int i) | |
{ | |
Console.WriteLine(i); | |
} |
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 i = 1; | |
ref readonly var j = ref Print(ref i); | |
Console.WriteLine(i); | |
ref int Print(ref int i) | |
{ | |
i++; | |
Console.WriteLine(i); |
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 i = 1; | |
ref var j = ref Print(ref i); | |
j++; | |
Console.WriteLine(i); | |
ref int Print(ref int i) | |
{ |
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
record Animal(string name); |
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
record Animal | |
{ | |
public string Name { get; init; } | |
} |
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 Animal | |
{ | |
public readonly string Name { get; init; } | |
} | |
struct Animal | |
{ | |
public string Name { get; init; } | |
} |
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
ref struct Animal | |
{ | |
public string Name { get; init; } | |
} |
OlderNewer