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
class Program | |
{ | |
static void Main() | |
{ | |
new PublicConstructor(""); // OK | |
new PrivateConstructor(""); // error CS0122: 'Program.PrivateConstructor.PrivateConstructor(string)' is inaccessible due to its protection level | |
new PrimaryConstructor(""); // OK | |
} | |
private class PrimaryConstructor(string firstName) |
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.Diagnostics; | |
using System.Threading.Tasks; | |
class Program | |
{ | |
private static void Main() | |
{ | |
MainAsync().Wait(); | |
} |
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
any_of(list.begin(), list.end(), [](SomeType x){ return predicate(x); }) |
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 TimeUnits; | |
public static class Program | |
{ | |
public void Main() | |
{ | |
Console.WriteLine(70.5 * s); | |
} | |
} |
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
.assembly ActionTest {} | |
.assembly extern mscorlib | |
{ | |
.ver 4:0:0:0 | |
.publickeytoken = (B7 7A 5C 56 19 34 E0 89) | |
} | |
.namespace Test | |
{ |
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; | |
static class Program | |
{ | |
private static void Main() | |
{ | |
Intermediary<C>(); | |
Console.WriteLine(); | |
Intermediary<S>(); | |
} |
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 cdict = new ConcurrentDictionary<int, int>(); | |
var t = Task.Run(() => { | |
for (int i = 0; i < 100000; i++) | |
cdict[i] = i; | |
}); | |
IEnumerable<KeyValuePair<int, int>> kvps = new ReadOnlyDictionary<int, int>(cdict); | |
((ICollection<KeyValuePair<int, int>>)kvps).IsReadOnly.Dump(); // true |
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.Threading.Tasks; | |
class Program | |
{ | |
static void M(Func<Task<int>> f, int i) | |
{ } | |
static void M(Func<int> f, 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
using System; | |
using System.Net; | |
using System.Xml; | |
using System.Linq; | |
public class Test | |
{ | |
public static void Main() | |
{ | |
Console.Write("ICO: "); |
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.Linq; | |
using Castle.DynamicProxy; | |
namespace AnotherContinent | |
{ | |
class Program | |
{ | |
static void Main() | |
{ |
OlderNewer