Skip to content

Instantly share code, notes, and snippets.

@ngohungphuc
Created August 2, 2019 08:56
Show Gist options
  • Save ngohungphuc/cd6eaa9ce33c061924f1b3c7ca928a3f to your computer and use it in GitHub Desktop.
Save ngohungphuc/cd6eaa9ce33c061924f1b3c7ca928a3f to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")
);
services
.AddMvc()
.AddJsonOptions(
options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
)
SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddScoped<Repository>();
services.AddScoped<Seeder>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment