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 UserManager() | |
: base(new UserStore<ApplicationUser>(new ApplicationDbContext())) | |
{ | |
UserValidator = new UserValidator<ApplicationUser>(this) { AllowOnlyAlphanumericUserNames = false }; | |
} |
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 Worker | |
{ | |
public void StartWork() | |
{ | |
for (var i = 0; i < 10; i++) | |
{ | |
OnInterestingEvent(); | |
Thread.Sleep(1000); | |
} | |
OnComplete(); |
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
<Window x:Class="WpfApplication8.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525" | |
<!-- event wire up here: --> | |
Loaded="MainWindow_Loaded"> | |
<Canvas x:Name="DrawingCanvas"> | |
</Canvas> |
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 Logger(Stream stream) : IDisposable | |
{ | |
public void Dispose() | |
{ | |
Stream.Dispose(); | |
} | |
public Stream Stream { get; set; } = stream; | |
} |
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
let range = function*(start, end){ | |
let current = start; | |
while(current < end){ | |
let newValue = yield current; | |
current = newValue ? newValue : current + 1; | |
} | |
}; | |
let stuff = range(0,3) |
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
let range = function*(start, end){ | |
for(var i = start; i <= end; i++){ | |
yield i; | |
} | |
}; | |
let n = [for (x of range(0,3)) x]; | |
expect(n).toEqual([0,1,2,3]); |
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
// this: | |
var foo = "hi!"; | |
var length = foo?.Length; | |
// will create this: | |
string str = "hi!"; | |
int? nullable = str != null ? new int?(str.Length) : new int?(); | |
// while this: | |
var foo = "hi!"; |
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 generatedCode = generator.TransformText(); | |
var comparer = DesktopAssemblyIdentityComparer.Default; | |
var options = new CSharpCompilationOptions( | |
OutputKind.DynamicallyLinkedLibrary, | |
assemblyIdentityComparer:comparer); | |
var tree = SyntaxFactory.ParseSyntaxTree(generatedCode); | |
var compilation = CSharpCompilation | |
.Create("measures.dll") |
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
<configuration> | |
<appSettings> | |
<add key="ClientValidationEnabled" value="true"/> | |
<add key="UnobtrusiveJavaScriptEnabled" value="true"/> | |
</appSettings> | |
</configuration> |
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 Employee | |
{ | |
public Employee() | |
{ | |
HomeAddress = new Address(); | |
} | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public Address HomeAddress { get; set; } |
OlderNewer