Skip to content

Instantly share code, notes, and snippets.

@Rudyzio
Created April 12, 2019 21:55
Show Gist options
  • Save Rudyzio/2cecf774bae879630fe3da2dc5faee2c to your computer and use it in GitHub Desktop.
Save Rudyzio/2cecf774bae879630fe3da2dc5faee2c to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DatabaseConnection")));
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2).AddJsonOptions(options =>
{
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment