- Run
$ docker-compose up -d
- Exec
$ docker-compose exec devbox-db psql devbox
public class Pattern<TReturn> | |
: List<(Type Type, Func<object, TReturn> Map)> | |
{ | |
public void Add<T>(Func<T, TReturn> map) | |
=> Add((typeof(T), o => map((T)o))); | |
public Pattern<TReturn> Default(TReturn val) | |
{ | |
Add((object _) => val); | |
return this; |
using System; | |
using System.Threading.Tasks; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Diagnostics; | |
using System.Net.Sockets; | |
namespace ConsolePortScanner | |
{ | |
class MainClass |
[RegularExpression(@"^\$?\d+(\.(\d{2}))?$")]
/*https://github.com/AutoMapper/AutoMapper/blob/18f974a091c910675eea599e6164e8b70ca3aae8/src/AutoMapper/Internal/LockingConcurrentDictionary.cs*/ | |
public struct LockingConcurrentDictionary<TKey, TValue> | |
{ | |
private readonly ConcurrentDictionary<TKey, Lazy<TValue>> _dictionary; | |
private readonly Func<TKey, Lazy<TValue>> _valueFactory; | |
public LockingConcurrentDictionary(Func<TKey, TValue> valueFactory) | |
{ | |
_dictionary = new ConcurrentDictionary<TKey, Lazy<TValue>>(); | |
_valueFactory = key => new Lazy<TValue>(() => valueFactory(key)); |
/*https://github.com/AutoMapper/AutoMapper/blob/18f974a091c910675eea599e6164e8b70ca3aae8/src/AutoMapper/Execution/ProxyGenerator.cs*/ | |
public static class ProxyGenerator | |
{ | |
private static readonly byte[] privateKey = | |
StringToByteArray( | |
"002400000480000094000000060200000024000052534131000400000100010079dfef85ed6ba841717e154f13182c0a6029a40794a6ecd2886c7dc38825f6a4c05b0622723a01cd080f9879126708eef58f134accdc99627947425960ac2397162067507e3c627992aa6b92656ad3380999b30b5d5645ba46cc3fcc6a1de5de7afebcf896c65fb4f9547a6c0c6433045fceccb1fa15e960d519d0cd694b29a4"); | |
private static readonly byte[] privateKeyToken = StringToByteArray("be96cd2c38ef1005"); | |
private static readonly MethodInfo delegate_Combine = typeof(Delegate).GetRuntimeMethod("Combine", new[] { typeof(Delegate), typeof(Delegate) }); |