// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddCors(options => { options.AddPolicy("AllowOrigin", builder => builder.WithOrigins("http://localhost:4200")); }); var tokenOptions = Configuration.GetSection("TokenOptions").Get <TokenOptions>(); services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = true, ValidateAudience = true, ValidateLifetime = true, ValidIssuer = tokenOptions.Issuer, ValidAudience = tokenOptions.Audience, ValidateIssuerSigningKey = true, IssuerSigningKey = SecurityKeyHelper.CraeteSecurityKey(tokenOptions.SecurityKey) }; }); //services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); => core'a taþýndý //ServiceTool.Create(services); //IServiceCollection'A extensions yazýp AddDependencyResolvers class yaz=> istediðimiz kadar baðýmlýlýk versek services.AddDependencyResolvers(new ICoreModule[] { new CoreModule() }); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "WebUI", Version = "v1" }); }); }