Created
August 2, 2019 08:56
-
-
Save ngohungphuc/cd6eaa9ce33c061924f1b3c7ca928a3f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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