Skip to content

Instantly share code, notes, and snippets.

@talkingdotnet
Created April 4, 2018 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talkingdotnet/f795e1234b49a2115b15a6384ad0b0a0 to your computer and use it in GitHub Desktop.
Save talkingdotnet/f795e1234b49a2115b15a6384ad0b0a0 to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
// Use Entity Framework in-memory provider for this sample
services.AddDbContext<ToDoListContext>(options => options.UseInMemoryDatabase("ToDoList"));
services.AddMvc().AddJsonOptions(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});
services.AddResponseCompression(options =>
{
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[]
{
MediaTypeNames.Application.Octet,
WasmMediaTypeNames.Application.Wasm,
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment