File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
developments/BlazorComponent/BlazorComponent Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ using BlazorComponent . Components ;
2+ using BlazorComponent . Repositories ;
3+
4+ var builder = WebApplication . CreateBuilder ( args ) ;
5+
6+ // Add services to the container.
7+ builder . Services . AddRazorComponents ( )
8+ . AddInteractiveServerComponents ( ) ;
9+
10+ var connectionString = builder . Configuration . GetConnectionString ( "DefaultConnection" ) ;
11+
12+
13+ builder . Services . AddScoped < IMedicoRepository , MedicoRepository > ( ) ;
14+
15+ var app = builder . Build ( ) ;
16+
17+ // Configure the HTTP request pipeline.
18+ if ( ! app . Environment . IsDevelopment ( ) )
19+ {
20+ app . UseExceptionHandler ( "/Error" , createScopeForErrors : true ) ;
21+ // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
22+ app . UseHsts ( ) ;
23+ }
24+
25+ app . UseHttpsRedirection ( ) ;
26+
27+ app . UseStaticFiles ( ) ;
28+ app . UseAntiforgery ( ) ;
29+
30+ app . MapRazorComponents < App > ( )
31+ . AddInteractiveServerRenderMode ( ) ;
32+
33+ app . Run ( ) ;
You can’t perform that action at this time.
0 commit comments