File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
sample/EntityFrameworkCore.DataEncryption.Sample Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1+ using System . Text . Json . Serialization ;
2+ using EntityFrameworkCore . DataEncryption . Sample . Context ;
3+ using Microsoft . EntityFrameworkCore ;
4+
15var 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+
217var 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
628app . Run ( ) ;
You can’t perform that action at this time.
0 commit comments