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 HttpListenerHostWithConfiguration : HttpListenerHost | |
{ | |
private readonly IConfigurationSource _configuration; | |
public HttpListenerHostWithConfiguration(IConfigurationSource configuration) | |
{ | |
_configuration = configuration; | |
} | |
public override bool ConfigureRootDependencies(IDependencyResolver resolver) |
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 Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var serviceNamespace = typeof (Service).Namespace; | |
HostFactory.Run(x => | |
{ | |
x.Service<IService>(s => | |
{ |
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
[MediaType("application/json")] | |
public class JsonFxCodec : IMediaTypeWriter, IMediaTypeReader | |
{ | |
private readonly JsonWriter _writer; | |
private readonly JsonReader _reader; | |
public object Configuration { get; set; } | |
public JsonFxCodec() | |
{ | |
var resolver = new CombinedResolverStrategy( |
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
[MediaType("application/json;q=0.5", "json")] | |
public class NewtonsoftJsonCodec : IMediaTypeReader, IMediaTypeWriter | |
{ | |
public object Configuration { get; set; } | |
public object ReadFrom(IHttpEntity request, IType destinationType, string destinationName) | |
{ | |
using(var streamReader = new StreamReader(request.Stream)) | |
{ | |
var ser = new JsonSerializer(); |
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 NHibernateSessionPipelineContributor : IPipelineContributor | |
{ | |
private readonly IDependencyResolver _resolver; | |
public NHibernateSessionPipelineContributor(IDependencyResolver resolver) | |
{ | |
_resolver = resolver; | |
} | |
public void Initialize(IPipeline pipelineRunner) |