This file contains hidden or 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
| async void Main() | |
| { | |
| GetType().Assembly.FullName.Dump(); | |
| IEnumerable<Model.ProcessingModel> models = | |
| Enumerable.Range(0, 1000000) | |
| .Select(n => new Model.ProcessingModel { InputA = n, InputB = n * 0.5M, Factor = 0.050M }); | |
| var sw = Stopwatch.StartNew(); | |
This file contains hidden or 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 Autofac; | |
| using Nancy; | |
| using Nancy.Bootstrapper; | |
| using Nancy.Bootstrappers.Autofac; | |
| using Nancy.Hosting.Self; | |
| using Nancy.Routing; | |
| public class Bootstrapper : AutofacNancyBootstrapper |
This file contains hidden or 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
| void Main() | |
| { | |
| using(var kernel = new StandardKernel(new CarModule())) | |
| { | |
| kernel.Load<FuncModule>(); // for sake of LinqPAD | |
| var factory = kernel.Get<ICarFactory>(); | |
| Assert.That(factory, Is.Not.Null); | |
This file contains hidden or 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
| IL_0037: ldtoken Model.ProcessingModel | |
| IL_003C: call System.Type.GetTypeFromHandle | |
| IL_0041: call System.Linq.Expressions.Expression.Parameter | |
| IL_0046: stloc.2 // modelParameter | |
| IL_0047: ldtoken Model.ReportModel | |
| IL_004C: call System.Type.GetTypeFromHandle | |
| IL_0051: call System.Linq.Expressions.Expression.Parameter | |
| IL_0056: stloc.3 // resultExpression | |
| IL_0057: ldc.i4.4 | |
| IL_0058: newarr System.Linq.Expressions.Expression |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <!-- | |
| Metaprogramming via scripting | |
| from book 'Metaprogramming in .NET' | |
| by Kevin Hazzard and Jason Bock | |
| http://www.manning.com/hazzard/ | |
| --> | |
| <html> | |
| <head> | |
| <script type="text/javascript"> |
This file contains hidden or 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
| // assume I have somewhere 'dynamic' code like, | |
| dynamic x = 10; | |
| // … some code … | |
| Console.WriteLine(Math.Sqrt(x)); // DLR call site is not expected in current solution |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <!-- | |
| Metaprogramming via scripting | |
| from book 'Metaprogramming in .NET' | |
| by Kevin Hazzard and Jason Bock | |
| http://www.manning.com/hazzard/ | |
| --> | |
| <html> | |
| <head> | |
| <script type="text/javascript"> |
This file contains hidden or 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
| void Main() | |
| { | |
| var mapping = new AutoMapperConfiguration(); | |
| mapping.SelfTest(); | |
| mapping.Map<Person, PersonDTO>(new Person { FullName = "Ola Hansen" }).Dump(); | |
| mapping.Map<Turtle, TurtleDTO>(new Turtle { NickName = "Tortilla" }).Dump(); | |
| } | |
| public class AutoMapperConfiguration |
This file contains hidden or 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 static ImmutableHashSet<Cell> Next(ImmutableHashSet<Cell> generation) | |
| { | |
| return ImmutableHashSet.Create( | |
| generation | |
| .AsParallel() | |
| .AsUnordered() | |
| .SelectMany(cell => | |
| new[] | |
| { | |
| new { alive = false, x = cell.X - 1, y = cell.Y - 1, density = 1 }, |
This file contains hidden or 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
| Expected: null | |
| But was: "{ | |
| "DomainManager": null, | |
| "Evidence": [ | |
| { | |
| "SecurityZone": 0 | |
| }, | |
| { | |
| "Value": "file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2012/nCrunch.TaskRunner.DLL" | |
| } |