1212 using Microsoft . Extensions . Configuration ;
1313 using Microsoft . Extensions . DependencyInjection ;
1414 using Microsoft . IdentityModel . Tokens ;
15+ using SqlKata . Execution ;
1516 using Swashbuckle . AspNetCore . Swagger ;
17+ using MySql . Data . MySqlClient ;
18+ using SqlKata . Compilers ;
19+
1620 public class Startup
1721 {
1822 private const string _defaultCorsPolicyName = "localhost" ;
@@ -26,8 +30,7 @@ public Startup(IConfiguration configuration)
2630 // This method gets called by the runtime. Use this method to add services to the container.
2731 public void ConfigureServices ( IServiceCollection services )
2832 {
29-
30-
33+
3134 services . Configure < List < Role > > ( Configuration . GetSection ( "RoleList" ) ) ;
3235 services . Configure < Dictionary < string , string > > ( Configuration . GetSection ( "tablempper" ) ) ;
3336 services . Configure < TokenAuthConfiguration > ( tokenAuthConfig =>
@@ -40,9 +43,11 @@ public void ConfigureServices(IServiceCollection services)
4043 } ) ;
4144 AuthConfigurer . Configure ( services , Configuration ) ;
4245
43- services . AddCors ( options => options . AddPolicy ( _defaultCorsPolicyName , builder => builder . AllowAnyOrigin ( )
46+ services . AddCors ( options => options . AddPolicy ( _defaultCorsPolicyName ,
47+ builder =>
48+ builder . AllowAnyOrigin ( )
4449 . AllowAnyHeader ( )
45- . AllowAnyMethod ( )
50+ . AllowAnyMethod ( ) . AllowCredentials ( )
4651 ) ) ;
4752 services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_1 ) ;
4853 services . AddSwaggerGen ( c =>
@@ -55,12 +60,15 @@ public void ConfigureServices(IServiceCollection services)
5560 services . AddSingleton < IHttpContextAccessor , HttpContextAccessor > ( ) ;
5661 services . AddTransient < IIdentityService , IdentityService > ( ) ;
5762 services . AddTransient < ITableMapper , TableMapper > ( ) ;
63+
5864 }
5965
6066 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
6167 public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
6268 {
69+
6370 app . UseAuthentication ( ) ;
71+
6472 app . UseMvc ( routes =>
6573 {
6674 routes . MapRoute (
0 commit comments