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
<?xml version="1.0"?> | |
<appSettings> | |
<!-- This line responsible for nhibernate logging --> | |
<add key="nhibernate-logger" value="NHibernate.Logging.CommonLogging.CommonLoggingLoggerFactory, NHibernate.Logging.CommonLogging" /> | |
</appSettings> |
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 abstract class ScenarioRunner<T> : IScenarioRunner<T> where T : ScenarioBase | |
{ | |
protected ScenarioRunner( | |
ISession session, | |
IScenarioService<T> scenarioService, | |
IScenarioBrokerService brokerService) | |
{ | |
_session = session; | |
_scenarioService = scenarioService; | |
_brokerService = brokerService; |
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 ResponseInterceptorMiddleware | |
{ | |
public ResponseInterceptorMiddleware( | |
Func<IDictionary<string, object>, Task> next, | |
string exceptionFormat | |
) | |
{ | |
_next = next; | |
_exceptionFormat = exceptionFormat; | |
} |
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 NamespaceHttpControllerSelector : IHttpControllerSelector | |
{ | |
private const string NamespaceKey = "namespace"; | |
private const string ControllerKey = "controller"; | |
private readonly HttpConfiguration _configuration; | |
private readonly Lazy<Dictionary<string, HttpControllerDescriptor>> _controllers; | |
private readonly HashSet<string> _duplicates; | |
public NamespaceHttpControllerSelector(HttpConfiguration config) |
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 PassthroughHandler : ExceptionHandler | |
{ | |
public override void Handle(ExceptionHandlerContext context) | |
{ | |
var info = ExceptionDispatchInfo.Capture(context.Exception); | |
info.Throw(); | |
} | |
} |
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 class HttpPropertyKeys | |
{ | |
public static readonly string UptimeMiddlewarePath = "/uptime"; | |
} |
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
// Implementation of custom NHibernate type, that helps to store and retrive JSON format | |
// JsonFormatter - static class with Serialize/Deserialize methods (with JsonConvert implementation for example) | |
namespace Tm.NHibernate.Types | |
{ | |
public class JsonMappableType<T> : IUserType where T : class | |
{ | |
public new bool Equals(object x, object y) | |
{ | |
if (x == null && y == null) |
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 Newtonsoft.Json; | |
using Newtonsoft.Json.Converters; | |
using Newtonsoft.Json.Linq; | |
using System; | |
using System.Collections.Generic; | |
namespace ConsoleApplication1 { | |
class Program { | |
static void Main(string[] args) { | |
const string response = @" |
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 void DifferentScopes(int arg) | |
{ | |
Func<int, Func<int>> preventClosure = (val) => () => val; | |
{ | |
int local = 42; | |
Func<int> a = () => preventClosure(local)(); | |
Func<int> b = () => preventClosure(local)(); | |
} |
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 HttpClientProxy : IHttpClientProxy | |
{ | |
private static readonly HttpClient client = new HttpClient(); | |
private readonly PolicyWrap<HttpResponseMessage> policy; | |
public HttpClientProxy() | |
{ | |
RetryPolicy<HttpResponseMessage> waitAndRetryPolicy = Policy | |
.HandleResult<HttpResponseMessage>(e => e.StatusCode == HttpStatusCode.RequestTimeout) | |
.WaitAndRetryAsync( |
OlderNewer