- classes
- interfaces
- null
- conditional statements
- async
- lync
- value types
- referene types
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 class TestMessage | |
| { | |
| } | |
| public class TestMessageConsumerA : Consumes<TestMessage>.All | |
| { | |
| public void Consume(TestMessage message) | |
| { | |
| Console.WriteLine("Consume A"); | |
| } |
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
| [Test] | |
| public void Test() | |
| { | |
| var foo = new Foo().Fluent() | |
| .WithName("Bob") | |
| .WithAge(12); | |
| Console.WriteLine(foo.Name); | |
| Console.WriteLine(foo.Age); | |
| } |
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
| namespace ConsoleApplication3 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine(Fac(1000000).ToString("E4")); | |
| Console.ReadKey(); | |
| } |
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
| Has anyone ever had an issue with assembly load failing occasionally in an azure role but working fine locally? if I restart my service it will work for a while then eventually fail with the following: | |
| System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) | |
| File name: 'Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
| We have version 5.6.1.1 of that assembly referenced with the appropriate binding redirect in place, it does SOMETIMES work so it can't be solely the redirect. I even tried to turn on fusion logging and while I can see logs for other assemblies I cannot see any references to this assembly in the logs. | |
| Any ideas how to track this down? |
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() | |
| { | |
| FormatUsingSerilog("{Message} {Number}", "Foo", 2).Dump(); // Outputs: "Foo" 2 | |
| FormatUsingSerilog("{@Foo}", new { Property = 2 }).Dump(); // Outputs: { Property = 2 } | |
| FormatUsingSerilog("{@Foo}", new Foo { Property = 2 }).Dump(); // Outputs: UserQuery+Foo | |
| } | |
| static string FormatUsingSerilog(string format, params object[] args) { | |
| var parser = new MessageTemplateParser(); | |
| var template = parser.Parse(format); |
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 class ParentActor : ReceiveActor { | |
| private ActorRef _child; | |
| public ParentActor() { | |
| _child = Context.ActorOf<Child>(); | |
| Receive<Start>(m => { | |
| _child.Tell(new Child.Start{State = 123})); | |
| }); | |
| } |
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
| ubuntu@connect-mongo-rs1b:/data$ echo "{nThreads:32,fileSizeMB:1000,r:true}" | sudo mongoperf | |
| mongoperf | |
| use -h for help | |
| parsed options: | |
| { nThreads: 32, fileSizeMB: 1000, r: true } | |
| creating test file size:1000MB ... | |
| testing... | |
| options:{ nThreads: 32, fileSizeMB: 1000, r: true } | |
| wthr 32 | |
| new thread, total running : 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
| echo "{nThreads:32,fileSizeMB:1000,w:true}" | sudo mongoperf | |
| mongoperf | |
| use -h for help | |
| parsed options: | |
| { nThreads: 32, fileSizeMB: 1000, w: true } | |
| creating test file size:1000MB ... | |
| testing... | |
| options:{ nThreads: 32, fileSizeMB: 1000, w: true } | |
| wthr 32 | |
| new thread, total running : 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
| echo "{nThreads:32,fileSizeMB:1000,r:true}" | sudo mongoperf | |
| mongoperf | |
| use -h for help | |
| parsed options: | |
| { nThreads: 32, fileSizeMB: 1000, r: true } | |
| creating test file size:1000MB ... | |
| testing... | |
| options:{ nThreads: 32, fileSizeMB: 1000, r: true } | |
| wthr 32 | |
| new thread, total running : 1 |