Skip to content

Commit 649dcd6

Browse files
🔨 Configure init settings
1 parent e0b208d commit 649dcd6

File tree

1 file changed

+23
-1
lines changed
  • sample/EntityFrameworkCore.DataEncryption.Sample

1 file changed

+23
-1
lines changed
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1+
using System.Text.Json.Serialization;
2+
using EntityFrameworkCore.DataEncryption.Sample.Context;
3+
using Microsoft.EntityFrameworkCore;
4+
15
var builder = WebApplication.CreateBuilder(args);
6+
7+
builder.Services.AddControllersWithViews().AddJsonOptions(options =>
8+
{
9+
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
10+
});
11+
12+
builder.Services.AddDbContext<SampleDbContext>(options =>
13+
{
14+
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"));
15+
});
16+
217
var app = builder.Build();
318

4-
app.MapGet("/", () => "Hello World!");
19+
if (app.Environment.IsDevelopment())
20+
{
21+
app.UseDeveloperExceptionPage();
22+
}
23+
24+
app.MapControllers();
25+
26+
app.MapDefaultControllerRoute();
527

628
app.Run();

0 commit comments

Comments
 (0)