Skip to content

Instantly share code, notes, and snippets.

@markcoleman
Last active December 10, 2015 21:28
Show Gist options
  • Save markcoleman/4494882 to your computer and use it in GitHub Desktop.
Save markcoleman/4494882 to your computer and use it in GitHub Desktop.
NancyFX Bootstrapper with Unity and Json.Net Json.Net is also configure with CamelCaseProperyNameContractResolver()
public class Bootstrapper : UnityNancyBootstrapper
{
protected override void RegisterTypes(IUnityContainer container, IEnumerable<TypeRegistration> typeRegistrations)
{
base.RegisterTypes(container, typeRegistrations);
container.RegisterInstance(
JsonSerializer.Create(new JsonSerializerSettings()
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment