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 sealed class MyIssue | |
{ | |
[Fact] | |
void Verify() { | |
var serializer = new ConfigurationContainer( ).ConfigureType<SubjectRequest>( ).EnableImplicitTypingFromNamespace<MyIssue>( ).Create( ).ForTesting( ); | |
var subjectRequest = | |
new SubjectRequest { | |
SomeInterface = new Subject2 { Message = "message1", Message2 = "message2" } | |
}; |
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; | |
using System.Collections.Generic; | |
struct TestEnumerator<T> : IEnumerator<T> | |
{ | |
ArraySegment<T> m_Segment; | |
public TestEnumerator(ref ArraySegment<T> seg) | |
{ | |
m_Segment = seg; | |
} |
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 Analogy | |
{ | |
/// <summary> | |
/// This example shows that a library that needs access to target .NET Standard 1.3 | |
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
/// </summary>INetCoreApp10 | |
class Example1 | |
{ | |
public void Net45Application(INetFramework45 platform) |
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 System.IO; | |
using System.Net.Security; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using ICSharpCode.SharpZipLib.Zip.Compression; | |
using ICSharpCode.SharpZipLib.Zip.Compression.Streams; | |
using Microsoft.Extensions.Logging; |
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 class Coroutine { | |
public static void BeginExecute(IEnumerable<Promise> enumerable) { | |
MoveNext(enumerable.GetEnumerator()); | |
} | |
static void MoveNext(IEnumerator<Promise> enumerator) { | |
if (enumerator.MoveNext()) { | |
var promise = enumerator.Current; | |
promise.Current = promise.Task(); | |
promise.Current._CallBack = () => MoveNext(enumerator); |
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.Diagnostics; | |
using System.IO; | |
using System.IO.MemoryMappedFiles; | |
using System.Runtime.CompilerServices; | |
using System.Threading.Tasks; | |
namespace FileAnalyzer | |
{ | |
public static unsafe class NativeRecord |
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.Diagnostics; | |
using System.IO; | |
using System.IO.MemoryMappedFiles; | |
namespace FileAnalyzer | |
{ | |
public static unsafe class NativeRecord | |
{ | |
private static readonly int[] DaysToMonth365 = |
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
export default function createReducer(initialState, handlers) { | |
return function reducer(state = initialState, action) { | |
if (handlers.hasOwnProperty(action.type)) { | |
return handlers[action.type](state, action) | |
} else { | |
return state | |
} | |
} | |
} |
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 class DumperExtensions | |
{ | |
public static string DumpToString(this object a, int maxDepth = 16, bool breakCircularRefs = false) | |
{ | |
return new Dumper(a, maxDepth, breakCircularRefs).ToString(); | |
} | |
public static T DumpToConsole<T>(this T a, int maxDepth = 16, bool breakCircularRefs = false) | |
{ | |
Console.Out.WriteLine(DumpToString(a, maxDepth, breakCircularRefs)); |
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.Security.Cryptography; | |
using System.Text; | |
using Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Crypto.Digests; | |
using Org.BouncyCastle.Math; | |
namespace ConsoleApp3 | |
{ | |
//https://gist.github.com/guywald/7a753e032ca2f979453b7f8aa4fb6569 |