Lazy Loading fix, new migration, Rents Index data

This commit is contained in:
Dimitar Byalkov
2022-04-09 03:21:47 +03:00
parent 21117225b7
commit 9c857a9458
14 changed files with 143 additions and 92 deletions

View File

@@ -29,7 +29,7 @@ namespace API
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<RentACarDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
options.UseLazyLoadingProxies().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddDatabaseDeveloperPageExceptionFilter();
services.AddIdentity<User, IdentityRole>(options =>
{
@@ -45,7 +45,6 @@ namespace API
.AddDefaultUI()
.AddDefaultTokenProviders()
.AddEntityFrameworkStores<RentACarDbContext>();
services.AddControllersWithViews();
services.AddRazorPages();
}