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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace crap | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Data; |
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
namespace crap | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
public class PartialAppPlayground | |
{ | |
private static Dispatcher<IHandlerResult> _dispatcher; |
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 Dispatcher<TMessage, TResult> | |
{ | |
private readonly Dictionary<Type, Func<TMessage, TResult>> _dictionary = new Dictionary<Type, Func<TMessage, TResult>>(); | |
public void Register<T>(Func<T, TResult> func) where T : TMessage | |
{ | |
_dictionary.Add(typeof(T), x => func((T)x)); | |
} | |
public TResult Dispatch(TMessage m) |
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 Nothing | |
{ | |
private Nothing() {} | |
public static readonly Nothing Value=new Nothing(); | |
public override string ToString() | |
{ | |
return "Nothing"; | |
} | |
} |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace crap | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Data; |
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
namespace crap | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
public class PartialAppPlayground |
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 static ArraySegment<byte> Serialize<T>(this T protoContract) | |
{ | |
using (var memory = new MemoryStream()) | |
{ | |
Serializer.Serialize(memory, protoContract); | |
var res = new ArraySegment<byte>(memory.GetBuffer(), 0, (int) memory.Length); | |
return res; | |
} | |
} |
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 o = | |
JArray.Parse(@"[ | |
{ | |
""eventId"": ""fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4"", | |
""eventType"": ""event-type"", | |
""data"": { | |
""BirthDate"": ""1987-11-07T00:00:00.000+01:00"" | |
} | |
} |
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
JsonConvert.DefaultSettings = () => new JsonSerializerSettings | |
{ | |
DateParseHandling = DateParseHandling.None | |
}; | |
var foo = JsonConvert.DeserializeObject(@"[ | |
{ | |
""eventId"": ""fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4"", | |
""eventType"": ""event-type"", | |
""data"": { |
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
==20921== 2350 errors in context 22 of 32: | |
==20921== Conditional jump or move depends on uninitialised value(s) | |
==20921== at 0x51369C: sgen_sort_addresses (sgen-gc.c:1447) | |
==20921== by 0x52B879: sgen_optimize_pin_queue (sgen-pinning.c:154) | |
==20921== by 0x514803: major_copy_or_mark_from_roots (sgen-gc.c:2855) | |
==20921== by 0x515265: major_do_collection (sgen-gc.c:3277) | |
==20921== by 0x518F47: sgen_perform_collection (sgen-gc.c:3461) | |
==20921== by 0x51A8F4: sgen_los_alloc_large_inner (sgen-los.c:346) | |
==20921== by 0x50B1B2: mono_gc_alloc_obj_nolock (sgen-alloc.c:204) | |
==20921== by 0x50B6D7: mono_gc_alloc_vector (sgen-alloc.c:491) |