Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Program.cs 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using BlackRock.Reporting.API.Core;
  2. using BlackRock.Reporting.API.Mediator;
  3. using BlackRock.Reporting.API.Persistence;
  4. using BlackRock.Reporting.API.Profiles;
  5. using MediatR;
  6. using System.Reflection;
  7. var builder = WebApplication.CreateBuilder(args);
  8. // Add services to the container.
  9. builder.Services.AddCors();
  10. builder.Services.AddControllers();
  11. builder.Services.AddAutoMapper(typeof(Profiler));
  12. builder.Services.AddScoped<IGenerator, PdfGenerator>();
  13. // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
  14. builder.Services.AddEndpointsApiExplorer();
  15. builder.Services.AddSwaggerGen();
  16. builder.Services.AddMediatR(typeof(Program));
  17. var app = builder.Build();
  18. // Configure the HTTP request pipeline.
  19. app.UseCors(options =>
  20. options.AllowAnyHeader()
  21. .AllowAnyMethod()
  22. .AllowAnyOrigin()
  23. );
  24. if (app.Environment.IsDevelopment())
  25. {
  26. app.UseSwagger();
  27. app.UseSwaggerUI();
  28. }
  29. app.UseHttpsRedirection();
  30. app.UseAuthorization();
  31. app.MapControllers();
  32. app.Run();