Skip to content

Commit 46cd55c

Browse files
committed
Adding null-safe code in page models
1 parent 782383e commit 46cd55c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
builder.Services.AddRazorPages();
1313

1414
builder.Services.AddDbContext<InventoryDbContext>(options =>
15-
options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING")));
15+
options.UseSqlServer(
16+
builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING"),
17+
sqlOptions => sqlOptions.EnableRetryOnFailure()
18+
));
1619

1720
builder.Services.AddScoped<UnitOfWork>();
1821
builder.Services.AddScoped<IDeviceService, DeviceService>();

0 commit comments

Comments
 (0)