using DTO; using Shared; using StubApi; using Contextlib; using Entity; using StubbedContextLib; using ServicesApi; using Microsoft.EntityFrameworkCore; //API var builder = WebApplication.CreateBuilder(args); builder.Services.AddScoped, UserService>(); builder.Services.AddScoped, QuoteService>(); builder.Services.AddScoped, FavoriteService>(); builder.Services.AddScoped, CommentaryService>(); builder.Services.AddScoped, CharacterService>(); builder.Services.AddScoped, ImageService>(); builder.Services.AddScoped, SourceService>(); builder.Services.AddScoped, QuestionService>(); //EF builder.Services.AddScoped(); builder.Services.AddScoped, DbUsersManager>(); builder.Services.AddScoped, DbQuoteManager>(); builder.Services.AddScoped, DbFavoriteManager>(); builder.Services.AddScoped, DbCommentaryManager>(); builder.Services.AddScoped, DbCharacterManager>(); builder.Services.AddScoped, DbImagesManager>(); builder.Services.AddScoped, DbSourceManager>(); builder.Services.AddScoped, DbQuestionManager>(); //... // Add services to the container. builder.Services.AddControllers(); builder.Services.AddOpenApiDocument(options => { options.PostProcess = document => { document.Info = new NSwag.OpenApiInfo { Version = "v1", Title = "What The Fantasy's API", Description = "What The Fantasy Site API", TermsOfService = "", Contact = new NSwag.OpenApiContact { Name = "The PM Mobile What The Fantasy team", Url = "" }, License = new NSwag.OpenApiLicense { Name = "No license", Url = "https://license.fr" } }; }; }); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseOpenApi(); // Active la documentation OpenAPI app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run();